smontanari / code-forensics

A toolset for code analysis and report visualisation
384 stars 45 forks source link

failure with minimal configuration #27

Closed hsendoa closed 6 years ago

hsendoa commented 6 years ago

the gulp command not found the subtask

C:>gulp [15:21:31] Using gulpfile ~\gulpfile.js [15:21:31] Task 'default' is not in your gulpfile [15:21:31] Please check the documentation for proper gulpfile formatting after add the default task in the gulpfile.js

like this

var gulp = require('gulp'),
code = require('code-forensics');
gulp.task('default', function() {
    // Code for the default task
});

throw

C:>gulp [15:22:14] Using gulpfile ~\gulpfile.js [15:22:14] Starting 'default'... [15:22:14] Finished 'default' after 301 µs

if I try to usage the other command, it's fail

C:>gulp commit-message-analysis [15:28:05] Using gulpfile ~\gulpfile.js [15:28:05] Task 'commit-message-analysis' is not in your gulpfile [15:28:05] Please check the documentation for proper gulpfile formatting

gernotstarke commented 6 years ago

imho the minimal gulpfile.js should look like:

require('code-forensics').configure(
  {
    repository: {
      rootPath: "./",
    }
  }
);

@hsendoa - have you tried that?

smontanari commented 6 years ago

@hsendoa please take the time to read the documentation. It explains how to configure and run the program. The minimal configuration suggested in the README can take you a little further but I strongly recommend you read the wiki to properly setup your environment. I would personally advise against the configuration suggested by @gernotstarke, because you would end up adding files and code to the very repository you want to analyse. code-forensics should be executed in a folder that is separate from the repository path you wish to analyse

gernotstarke commented 6 years ago

acutally the gulpfile.js is quoted from the documentation wiki......

I added this gulpfile to the directory containing my Dockerfile and docker-compose.yml.

smontanari commented 6 years ago

@gernotstarke the documentation doesn't suggest to place the gulpfile in the same folder as your repo and set the repository path as ./. That is what I would personally advise against. I don't know how you setup code-forensics in docker but again I would try to keep the repository files under analysis in a separate folder from where I run code-forensics.

hsendoa commented 6 years ago

thanks @gernotstarke and @smontanari .. First, the rootPath is the server rootPath(for example: svn://server:port) or the client rootPath (in windows would be D:\SVN). I use a node for windows in a fresh install, I make the npm install gulp -g npm install code-forensics npm install (for all dependencies) after I wrote the gulpfile.js like this:

require('code-forensics').configure(
  {
    repository: {
      rootPath: "C:\\SVN",
    }
  }
);

but when run the gulp command gulp the console return that not found the default task. when run the gulp command gulp webserver the console return that not found the webserver task.

My apologies for my bad question, but I don't have idea about this error.

smontanari commented 6 years ago

Unfortunately I can't debug a windows setup. In particular it's strange that you don't see any error or stack trace in the console. The configure function generates the gulp tasks dynamically based on the task definition javascript files contained in the code-forensics package. It could be that the way files are found/loaded doesn't work as expected in windows hence no tasks are created, but I'm only speculating. If you know javascript I can give you some hints on how to try and troubleshoot this, otherwise I would suggest you look at #21 and see how @jdevoo has made a dockerized code-forensics solution to run in a windows OS.

gernotstarke commented 6 years ago

@hsendoa, if you have Docker installed: here you find a proposal for a minimized Dockerfile that should work on windows...

hsendoa commented 6 years ago

thanks!.. It-s work (without docker)