smontanari / code-forensics

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

system evolution question #37

Closed jdevoo closed 5 years ago

jdevoo commented 5 years ago

Hello all,

I have been looking at system evolution for CrowdAI, a RoR-based machine learning competition site. I split the analysis as follows

    layerGroups: {
        'maint': [
            { name: 'app', paths: ['app', 'db', 'config'] },
            { name: 'test', paths: ['spec', 'scripts'] }
        ]
    }

Somehow I obtain a short time series on 'test' but the cumulative revisions vary over the entire period. Same picture when I reduce the interval from 1m to 2w for the long period.

system-evo-crowdai

system-evo-crowdai-rev

Not sure how to interpret this.

smontanari commented 5 years ago

I can take a look, is the code publicly accessible? Never mind I think I found it (https://github.com/crowdAI/crowdai)

jdevoo commented 5 years ago

Sorry Silvio - yes; here's the simplified gulpfile (dropped a few directories) I use --dateFrom=2016-01-01 --dateTo=2018-11-01 on all tasks.

// https://github.com/crowdAI/crowdai
require('code-forensics').configure({
    repository: {
        rootPath: 'repos/crowdai',
        excludePaths: [
            'log',
            'bin',
            'db',
            'doc',
            'docker',
            'vendor',
            'public',
            'lib',
            'config',
            'scripts',
            '**/+(.*|*.sql|*.svg|*.png|*.jpg|*.gif|*.ico|*.ini|*.ru|*.txt|*.csv|*.pdf|*.sh|*.example|*.lock|*.md|Procfile*|Gemfile|Rakefile|touchfile|tmpfile|*.json|*.scss)'
        ]
    },
    layerGroups: {
        'maint': [
            { name: 'app', paths: ['app'] },
            { name: 'test', paths: ['spec'] }
        ]
    },
    contributors: [
        ['Sean Carrol', 'Sean Carroll', 'seanfcarrol', 'Sean', 'sean'],
        ['SP Mohanty', 'spMohanty', 'S.P. Mohanty'], ['englhardt'],
        ['Djilani Kebaili', 'bkDJ', 'DJ'], ['balakirevs'], ['Zgore14'],
        ['ieggel'], ['XCaellaX'], ['Harry-Chen'], ['adrienpoly'],
        ['farnir'], ['jonasrauber']
    ]
})

My .code-forensics file is below

{
        "codeMaat": {
      "options": { "-n": 4, "-m": 4 }
    }
}
smontanari commented 5 years ago

I think I found out the glitch in the report. It's probably due to missing values in the generated reports, that would happen when there are no revisions for a certain period. In such case the value is undefined instead of 0, hence causing D3 to fail drawing the data plot. I labelled this issue as a bug and will do some more debugging. In the meantime if you still want to see that particular layer trend (i.e. the test code) you could do it by temporarily changing your repo configuration to only have the includePaths: ['spec'] and then running the system evolution report without a layer group parameter. Thanks @jdevoo for reporting this. It's definitely an error, although happening in a rather exceptional case (no commits or revisions data)

jdevoo commented 5 years ago

Thanks Silvio for looking into it.