smontanari / code-forensics

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

system evolution with layerGroups #16

Closed jdevoo closed 6 years ago

jdevoo commented 6 years ago

I have tried a system-evolution-analysis on alfresco-repository using the following gulpfile.js

require('code-forensics').configure({
    repository: {
        rootPath: 'repos/alfresco-repository',
        excludePaths: [
            'src/main/javadoc',
            'src/main/resources',
            'src/main/web',
            'src/main/META-INF',
            'src/test/resources'
        ],
        includePaths: [
            '**/+(*.java|*.js|*.cpp|*.h|*.html)'
        ],
        layerGroups: {
            'test': [
                { name: 'code', paths: ['src/test/java/org/alfresco/*.java', 'src/test/java/test/org/alfrecso/test_category'] },
                { name: 'repo', paths: ['src/test/java/org/alfresco/repo'] },
                { name: 'service', paths: ['src/test/java/org/alfresco/service'] },
                { name: 'OpenCMIS', paths: ['src/test/java/org/alfresco/opencmis'] },
                { name: 'other', paths: ['src/test/java/org/alfresco/email', 'src/test/java/org/alfresco/encryption', 'src/test/java/org/alfresco/filesys', 'src/test/java/org/alfresco/hearbeat', 'src/test/java/org/alfresco/tools', 'src/test/java/org/alfresco/traitextender', 'src/test/java/org/alfresco/util'] }
            ],
            'main': [
                { name: 'Windows', paths: ['src/main/cpp'] },
                { name: 'repo', paths: ['src/main/java/org/alfresco/repo'] },
                { name: 'service', paths: ['src/main/java/org/alfresco/service'] },
                { name: 'OpenCMIS', paths: ['src/main/java/org/alfresco/opencmis'] },
                { name: 'model', paths: ['src/main/java/org/alfresco/model'] },
                { name: 'other', paths: ['src/main/java/org/alfresco/email', 'src/main/java/org/alfresco/encryption', 'src/main/java/org/alfresco/filesys', 'src/main/java/org/alfresco/hearbeat', 'src/main/java/org/alfresco/tools', 'src/main/java/org/alfresco/traitextender', 'src/main/java/org/alfresco/util'] },
            ]
        }
    }
})

dateFrom is 2010-01-01 and dateTo is 2017-12-31 but it shows this in the logs...

[15:25:59] Using gulpfile ~/shared/gulpfile.js
[15:25:59] Starting 'vcs-log-dump'...
[15:25:59] Starting 'generate-layer-grouping-file'...
[15:25:59] No layer group parameter specified. No grouping file created.

I checked the doc but not sure what I missed...

I also notice the following entries in the log from this analysis - what are these related to?

Invalid CodeMaat output: >>This is Code Maat, a program used to collect statistics from a VCS.

smontanari commented 6 years ago

Are you passing a layerGroup parameter? If not, that probably explains the first message No layer group parameter specified...

The other log entries relate to a problem when code-forensics invokes code-maat. The message basically is the direct output of the code-maat program and what that means is that code-maat cannot parse the log input that it's being given. That could be because the log file is malformed for whatever reason, although it shouldn't happen as long as the git log command executes correctly. It could also happen because a log file for a particular time period is empty (and that depends on the activity on the repository) but again the last version of code-forensics should have rectified this behaviour.

I don't have much time until next week to take a deeper look at this, in the meantime here are a few tips to help you troubleshooting.

jdevoo commented 6 years ago

I am sorry - had missed that parameter in my notes. The other issue was with my malformed gulpfile above - layerGroups at the wrong level. The debug hint will help me as well. Closing this for now as I have not spent much time with code maat itself. Thank you!