smontanari / code-forensics

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

Knowledge-map-analysis rendering problems #44

Closed HerrTamm closed 3 years ago

HerrTamm commented 4 years ago

We are using Lerna for a multi-package monorepo. There are multiple subdirectories in packages/ directory, each containing the same base NodeJS project structure with source code having under src/, except that .git/ directory is only in the root path.

Only one of the packages is rendered correctly.

Output:

image

Config:

require('code-forensics').configure(
{
      repository: {
        rootPath: '../content-api/',
        includePaths: [
            'packages/content-api-importer/src/',
            'packages/content-api-graphql/src/',
            'packages/content-api-socialcount/src/',
         ],
      },
    },
    {
        dateFrom: '2000-01-01',
    }
);

Job logs:

$ COMMAND_DEBUG=true gulp knowledge-map-analysis
[11:46:46] Using gulpfile ~/projects/code-forensics/gulpfile.js
[11:46:46] Starting 'knowledge-map-analysis'...
[11:46:46] Starting 'parametersValidation'...
[11:46:46] Finished 'parametersValidation' after 725 μs
[11:46:46] Starting 'slocReport'...
[11:46:46] Analysing ../content-api/packages/content-api-importer/src/content/article_icons.js
[...analysing]
[11:46:46] Analysing ../content-api/packages/content-api-importer/src/content/fragments/fetchArticleVideoEmbed.js
[11:46:46] Starting 'vcsLogDump'...
[11:46:46] Finished 'vcsLogDump' after 7.58 ms
[11:46:46] Starting 'mainDevReport'...
[11:46:46] Analysing ../content-api/packages/content-api-importer/src/content/fragments/fetchCustomcode.js
[...analysing]
[11:46:46] Analysing ../content-api/packages/content-api-socialcount/src/utils/statusCheck.ts
[11:46:46] Running: java -Djava.awt.headless=true -jar /Users/rasmustam/projects/code-forensics/node_modules/code-forensics/lib/analysers/code_maat/code-maat-1.0.1-standalone.jar -c git2 -l /Users/rasmustam/projects/code-forensics/tmp/vcslog_normalised_2000-01-01_2019-09-13.log -a main-dev
[11:46:46] Finished 'slocReport' after 350 ms
[11:46:50] Finished 'mainDevReport' after 3.74 s
[11:46:50] Starting 'publishReport'...
[11:46:50] Generating report file 2000-01-01_2019-09-13_knowledge-map-data.json
[11:46:50] Open the following link to see the results:
[11:46:50] http://localhost:3000/index.html?reportId=8f1d28af040f4714ae699cef305e6370f1f9b7bc
[11:46:50] Finished 'publishReport' after 44 ms
[11:46:50] Finished 'knowledge-map-analysis' after 3.85 s
smontanari commented 4 years ago

First thing that comes to mind is to clear the log files before running the analysis. code-forensics does not execute the git log command again if it finds a log already generated for the exact same period of time (this is in order to save time). However if you happen to have changed the repository paths configuration you may have changed the file path selection criteria, hence you probably want to re-generate the log dump to include/exclude commits for files matching your configuration

smontanari commented 4 years ago

Hey I just released an update that could help, as it provides the ability to force the vcs log generation when running an analysis (see the wiki)

smontanari commented 3 years ago

closing due to no response/follow up.