smontanari / code-forensics

A toolset for code analysis and report visualisation
389 stars 48 forks source link

How does it work with current gulp version? #56

Closed st-schneider closed 4 years ago

st-schneider commented 4 years ago

It seems with the latest gulp version this doesn't work.

smontanari commented 4 years ago

it does work with gulp 4, is there a new version around? If you have an error post the log/error trace and I could try and help

st-schneider commented 4 years ago
image
smontanari commented 4 years ago

ok, I need more information:

st-schneider commented 4 years ago

ok, I need more information:

* what command you are running

gulp list-analysis-tasks

* where is your `gulp` module installed

globally but linked to local with npm link gulp

* what is the content of your `gulpfile.js`
require('code-forensics').configure(
{
repository: {
rootPath: ".",
}
}
);
smontanari commented 4 years ago

Thank you. I suspect your gulp link is the problem.

  1. First, if you follow the gulp documentation, the recommendation is to install globally only the gulp-cli package.
  2. When/if you link gulp-cli it should also create a gulp command link in the node_modules/.bin folders, as well as make it available in your PATH.
  3. Following that you can run npm install which will install gulp as a dependency of code-forensics.

I personally don't bother with any of the global install and linking (basically do just step 3) and just run npx gulp, but that is up to you.

A a side note, I would suggest you keep your code-forensic project in a separate folder than the root dir of the repository you intend to analyse, because the analysis will create its own folders and files which would end up also being included in subsequent analysis

st-schneider commented 4 years ago

Then let's find out if this works.

st-schneider commented 4 years ago

Thank you. I suspect your gulp link is the problem.

1. First, if you follow the gulp [documentation](https://gulpjs.com/docs/en/getting-started/quick-start), the recommendation is to install globally only the `gulp-cli` package.

2. When/if you link gulp-cli it should also create a `gulp` command link in the `node_modules/.bin` folders, as well as make it available in your PATH.

3. Following that you can run `npm install` which will install gulp as a dependency of code-forensics.

I personally don't bother with any of the global install and linking (basically do just step 3) and just run npx gulp, but that is up to you.

A a side note, I would suggest you keep your code-forensic project in a separate folder than the root dir of the repository you intend to analyse, because the analysis will create its own folders and files which would end up also being included in subsequent analysis

Great, that seems to work, also thanks for the suggestion to move stuff to a different directory. Any chance this could become a cli tool on its own?

smontanari commented 4 years ago

The process flow is currently very dependent on gulp. To make this a proper cli tool ideally I would implement my own process orchestration. Or I could wrap the gulp-cli around a cli-forensics cli. The first option is a lot of work and I'm not sure it's worth the effort (it would be a different conversation if code-forensics was a commercial software). The second option sounds a bit like sugar coating. However I'm open to suggestions and ideas, if you have any feel free to post an enhancement type of issue. In the meantime I'm closing this.