smontanari / code-forensics

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

Knowledge map analysis: "the given VCS data doesn't contain modification metrics" #43

Closed HerrTamm closed 4 years ago

HerrTamm commented 5 years ago

Hi,

I have problems running some analysers. One of the analysers is knowledge map analysis, which yields This is Code Maat, a program used to collect statistics from a VCS. and Code Maat yields churn analysis: the given VCS data doesn't contain modification metrics.

My Gulp settings:

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

Command: COMMAND_DEBUG=true gulp knowledge-map-analysis

Output:

[15:20:10] Using gulpfile ~/projects/code-forensics/gulpfile.js
[15:20:10] Starting 'knowledge-map-analysis'...
[15:20:10] Starting 'parametersValidation'...
[15:20:10] Finished 'parametersValidation' after 1.35 ms
[15:20:10] Starting 'slocReport'...
[15:20:10] Analysing ../content-api/packages/content-api-importer/src/utils/logger.js
[15:20:10] Starting 'vcsLogDump'...
[15:20:10] Finished 'vcsLogDump' after 4.87 ms
[15:20:10] Starting 'mainDevReport'...
[15:20:10] 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-08-26.log -a main-dev
[15:20:10] Finished 'slocReport' after 46 ms
[15:20:14] Invalid CodeMaat output: >>This is Code Maat, a program used to collect statistics from a VCS.
[15:20:14] Finished 'mainDevReport' after 4.02 s
[15:20:14] Starting 'publishReport'...
[15:20:14] Generating report file 2000-01-01_2019-08-26_knowledge-map-data.json
[15:20:14] Open the following link to see the results:
[15:20:14] http://localhost:3000/index.html?reportId=0fee18d2cb7678439967ad45acd55bcb71cbe4cd
[15:20:14] Finished 'publishReport' after 12 ms
[15:20:14] Finished 'knowledge-map-analysis' after 4.05 s

When executing Code Maat command:

$ 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-08-26.log -a main-dev
Invalid argument:  Internal error - please report it. Details = churn analysis: the given VCS data doesn't contain modification metrics. Check the code-maat docs for supported VCS and correct log format.

VCS log example contents:

--e474f512--2019-08-16--Rasmus Tamm

--17432d20--2019-08-16--Rasmus Tamm
--fd5425aa--2019-08-16--Rasmus Tamm

--ae12d326--2019-08-15--Rasmus Tamm

--62ba3ed1--2019-08-15--Rasmus Tamm
--945f39f1--2019-08-15--Rasmus Tamm

--a9934db9--2019-08-14--Rasmus Tamm

--59e8a5fb--2019-08-14--Rasmus Tamm

--bf7db233--2019-08-13--Rasmus Tamm

--b974f02f--2019-08-13--Rasmus Tamm

--06c9d37a--2019-08-13--Rasmus Tamm
smontanari commented 5 years ago

Well it's pretty obvious that the vcs log is empty, i.e. there is no information about any line changes on any file. Off the top of my head I could suggest to look at if and how you have configured the "include" or "exclude" filters for your target repository. Maybe they are eliminating all the files that have been changed as part of the git revisions, which would explain the empty log

HerrTamm commented 5 years ago

You can see from the logs, that it was analysing a file:

[15:20:10] Analysing ../content-api/packages/content-api-importer/src/utils/logger.js

Actually I initially tried with a whole src/ directory, which outputs

[15:32:48] Analysing ../content-api/packages/content-api-importer/src/slicer/rule/articleVideoEmbedParsing.js
[15:32:48] Analysing ../content-api/packages/content-api-importer/src/slicer/rule/customcodeEmbedParsing.js
[15:32:48] Analysing ../content-api/packages/content-api-importer/src/slicer/rule/daplayerEmbedParsing.js
[15:32:48] Analysing ../content-api/packages/content-api-importer/src/slicer/rule/dgsEmbedParsing.js
[15:32:48] Analysing ../content-api/packages/content-api-importer/src/slicer/rule/dvideoEmbedParsing.js
[15:32:48] Analysing ../content-api/packages/content-api-importer/src/slicer/rule/facebookEmbedParsing.js
[15:32:48] Analysing ../content-api/packages/content-api-importer/src/slicer/rule/featuredBlockEmbedParsing.js
[15:32:48] Analysing ../content-api/packages/content-api-importer/src/slicer/rule/iframeEmbedParsing.js
[15:32:48] Analysing ../content-api/packages/content-api-importer/src/slicer/rule/infogramEmbedParsing.js
[15:32:48] Analysing ../content-api/packages/content-api-importer/src/slicer/rule/liveblogJsEmbedParsing.js
[15:32:48] Analysing ../content-api/packages/content-api-importer/src/slicer/rule/liveblogPhpEmbedParsing.js
[15:32:48] Analysing ../content-api/packages/content-api-importer/src/slicer/rule/ogEmbedParsing.js
[15:32:48] Analysing ../content-api/packages/content-api-importer/src/slicer/rule/paperPulloutEmbedParsing.js
[15:32:48] Analysing ../content-api/packages/content-api-importer/src/slicer/rule/paperSidebarEmbedParsing.js
[15:32:48] Analysing ../content-api/packages/content-api-importer/src/slicer/rule/pictureEmbedParsing.js
[15:32:48] Analysing ../content-api/packages/content-api-importer/src/slicer/rule/playbuzzEmbedParsing.js
[15:32:48] Analysing ../content-api/packages/content-api-importer/src/slicer/rule/quizEmbedParsing.js
[15:32:48] Analysing ../content-api/packages/content-api-importer/src/slicer/rule/rembiEmbedParsing.js
[15:32:48] Analysing ../content-api/packages/content-api-importer/src/slicer/rule/twitterEmbedParsing.js
[15:32:48] Analysing ../content-api/packages/content-api-importer/src/slicer/rule/youtubeEmbedParsing.js
[15:32:48] Analysing ../content-api/packages/content-api-importer/src/utils/cli.js
[15:32:48] Analysing ../content-api/packages/content-api-importer/src/utils/config.js
[15:32:48] Analysing ../content-api/packages/content-api-importer/src/utils/getPixUrl.js
[15:32:48] Analysing ../content-api/packages/content-api-importer/src/utils/logger.js
[15:32:48] Analysing ../content-api/packages/content-api-importer/src/utils/test_cli.js

and a lot more, so I very much believe, that my exclude and include filters are just fine.

smontanari commented 5 years ago

The Analysing... messages refer to your current working tree, which may contain files which haven't been subject of revisions that are relevant to the analysis you are trying to run. What date range are you using? It could be that it is too restrictive and is excluding all those files. Also I don't see in your debug log the vcs command you're running, which makes me think the program is using a cached version of the log files. Try and clean the temporary directory, just in case you generated invalid log files in the past. I'm interested to understand this issue because, even if it wasn't a bug, it would represent an edge case that at least requires a better error message than what CodeMaat outputs

rasmustam123 commented 5 years ago

As you can see in my gulpfile.js I posted in the original post, dateFrom is '2000-01-01'

Also, in the logs I posted there's a line Generating report file 2000-01-01_2019-08-26_knowledge-map-data.json which indicates, that the date range should be correct.

Deleting tmp/ directory didn't help.

smontanari commented 5 years ago

Ok, now that I looked better at the first output you posted there are two things that are quite weird:

  1. The vcsLogDump task only lasts a handful of ms, which should not be the case given you're trying to produce a log for a very large date range.
  2. I can't see the program issuing the git log command. At a minimum (with no debug option) you should see something like Fetching git log from .... With the debug option you should see the output of the actual git log command executed, e.g. Running: git log --all --numstat --date=short --no-renames --pretty=format:--%h--%ad--%an --after ...

It seems the program is not running the git command. The only time the program does not actually run git is when the log files for the desired date range have been generated already, which should not be the case if you deleted the content of the tmp folder.

smontanari commented 4 years ago

@HerrTamm could you please do me the favour of deleting all the log files from the tmp folder and re-running your analysis task in debug mode, and then please report here the terminal output? If the git command is still not executed then I would have to do some serious debugging because it is supposed to happen and if it doesn't there is something clearly wrong. Thank you

HerrTamm commented 4 years ago
$ COMMAND_DEBUG=true gulp knowledge-map-analysis
[11:17:03] Using gulpfile ~/projects/code-forensics/gulpfile.js
[11:17:03] Starting 'knowledge-map-analysis'...
[11:17:03] Starting 'parametersValidation'...
[11:17:03] Finished 'parametersValidation' after 1.16 ms
[11:17:03] Starting 'slocReport'...
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/content/article_icons.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/content/article.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/content/attributes.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/content/author.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/content/banner.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/content/category.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/content/channel.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/content/comment.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/content/content_fragments.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/content/content_type.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/content/customblock.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/content/fragments/fetchArticleVideoEmbed.js
[11:17:03] Starting 'vcsLogDump'...
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/content/fragments/fetchCustomcode.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/content/fragments/fetchDgs.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/content/fragments/fetchDvideo.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/content/fragments/fetchFacebook.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/content/fragments/fetchFeaturedBlock.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/content/fragments/fetchHtml.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/content/fragments/fetchIframe.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/content/fragments/fetchInfogram.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/content/fragments/fetchLiveblog.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/content/fragments/fetchOgEmbed.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/content/fragments/fetchPicture.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/content/fragments/fetchPulloutAndSidebar.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/content/fragments/fetchRembi.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/content/fragments/fetchSendAHint.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/content/fragments/fetchStreamEvent.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/content/fragments/fetchTwitter.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/content/fragments/fetchVideoPlaylist.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/content/fragments/fetchYoutube.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/content/fragments/getFetchedEmbedCode.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/content/issue.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/content/lead_template.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/content/paywall.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/content/picture.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/content/pictureMasters.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/content/source.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/content/stream_event.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/content/tag.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/content/tagAlias.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/content/tagDomain.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/content/tagGroup.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/content/tagReference.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/content/targetblock.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/delfidb/constants/article.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/delfidb/constants/content_api_references.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/delfidb/constants/issue.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/delfidb/constants/relatedArticle.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/delfidb/constants/tag.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/delfidb/getAllChannelIds.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/delfidb/getArticle.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/delfidb/getArticleAttributes.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/delfidb/getArticleAuthors.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/delfidb/getArticleCategories.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/delfidb/getArticleCategoriesList.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/delfidb/getArticleIds.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/delfidb/getArticleIssues.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/delfidb/getArticlesForImport.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/delfidb/getArticleSources.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/delfidb/getArticleState.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/delfidb/getArticleTags.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/delfidb/getCategory.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/delfidb/getCategoryAttributes.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/delfidb/getCustomBlock.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/delfidb/getCustomBlockArticles.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/delfidb/getCustomBlockAttributes.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/delfidb/getCustomBlockCategories.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/delfidb/getCustomBlockIds.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/delfidb/getIssue.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/delfidb/getIssueArticles.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/delfidb/getIssueAttributes.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/delfidb/getIssueCoverArticles.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/delfidb/getIssueIds.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/delfidb/getIssueSortNr.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/delfidb/getIssueState.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/delfidb/getPictureById.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/delfidb/getPictures.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/delfidb/getPicturesMasters.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/delfidb/getRelatedArticles.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/delfidb/getTagAliases.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/delfidb/getTagById.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/delfidb/getTagDomainById.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/delfidb/getTagDomainIds.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/delfidb/getTagGroupById.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/delfidb/getTagGroupIds.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/delfidb/getTagGroupsByTagId.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/delfidb/getTagIds.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/delfidb/getTagReferences.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/delfidb/getTagsByParentId.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/delfidb/getTargetBlockArticleIds.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/delfidb/getTargetBlockAttributes.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/delfidb/getTargetBlockById.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/delfidb/getTargetBlocksIds.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/delfidb/isIssueVisible.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/delfidb/mysql/runQuery.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/delfidb/mysql/runWriteQuery.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/delfidb/saveReference.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/errors/ArticleDeletedError.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/errors/ResourceNotFoundError.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/graphql/createUpdateArticle.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/graphql/createUpdateCustomBlock.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/graphql/createUpdateIssue.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/graphql/createUpdateTag.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/graphql/createUpdateTagDomain.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/graphql/createUpdateTagGroup.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/graphql/createUpdateTargetBlock.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/graphql/deleteArticle.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/graphql/deleteCustomBlock.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/graphql/deleteIssue.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/graphql/deleteTag.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/graphql/deleteTagDomain.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/graphql/deleteTagGroup.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/graphql/deleteTargetBlock.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/graphql/utils/getClient.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/graphql/utils/mutate.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/rabbitmq/connect.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/rabbitmq/consume.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/rabbitmq/importers/article.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/rabbitmq/importers/customblock.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/rabbitmq/importers/index.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/rabbitmq/importers/issue.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/rabbitmq/importers/tag.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/rabbitmq/importers/tagDomain.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/rabbitmq/importers/tagGroup.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/rabbitmq/importers/targetblock.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/rabbitmq/importToRabbitmq.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/rabbitmq/RabbitMQListener.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/rabbitmq/send.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/rabbitmq/submitToRabbit.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/rabbitmq/validateSendToQueue.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/slicer/constants/embedTypes.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/slicer/constants/sliceTypes.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/slicer/getRawSlices.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/slicer/getSplittedSlices.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/slicer/index.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/slicer/matchEmbedCodeFromHtml.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/slicer/removePhpTags.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/slicer/rule/articleVideoEmbedParsing.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/slicer/rule/customcodeEmbedParsing.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/slicer/rule/daplayerEmbedParsing.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/slicer/rule/dgsEmbedParsing.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/slicer/rule/dvideoEmbedParsing.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/slicer/rule/facebookEmbedParsing.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/slicer/rule/featuredBlockEmbedParsing.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/slicer/rule/iframeEmbedParsing.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/slicer/rule/infogramEmbedParsing.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/slicer/rule/liveblogJsEmbedParsing.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/slicer/rule/liveblogPhpEmbedParsing.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/slicer/rule/ogEmbedParsing.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/slicer/rule/paperPulloutEmbedParsing.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/slicer/rule/paperSidebarEmbedParsing.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/slicer/rule/pictureEmbedParsing.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/slicer/rule/playbuzzEmbedParsing.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/slicer/rule/quizEmbedParsing.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/slicer/rule/rembiEmbedParsing.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/slicer/rule/twitterEmbedParsing.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/slicer/rule/youtubeEmbedParsing.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/utils/cli.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/utils/config.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/utils/getPixUrl.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/utils/logger.js
[11:17:03] Analysing ../content-api/packages/content-api-importer/src/utils/test_cli.js
[11:17:03] Fetching git log from 2000-01-01 to 2019-09-12
[11:17:03] Running: git log --all --numstat --date=short --no-renames --pretty=format:--%h--%ad--%an --after=1999-12-31T22:00:00.000Z --before=2019-09-12T20:59:59.999Z
[11:17:03] Finished 'slocReport' after 340 ms
[11:17:05] Created: vcslog_2000-01-01_2019-09-12.log
[11:17:05] Created: vcslog_normalised_2000-01-01_2019-09-12.log
[11:17:05] Finished 'vcsLogDump' after 2.61 s
[11:17:05] Starting 'mainDevReport'...
[11:17:05] 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-12.log -a main-dev
[11:17:11] Invalid CodeMaat output: >>This is Code Maat, a program used to collect statistics from a VCS.
[11:17:11] Finished 'mainDevReport' after 5.64 s
[11:17:11] Starting 'publishReport'...
[11:17:11] Generating report file 2000-01-01_2019-09-12_knowledge-map-data.json
[11:17:11] Open the following link to see the results:
[11:17:11] http://localhost:3000/index.html?reportId=2b4592282cbcabe0e63fdee560f19e8c8e6de542
[11:17:11] Finished 'publishReport' after 17 ms
[11:17:11] Finished 'knowledge-map-analysis' after 8.34 s
smontanari commented 4 years ago

thank you @HerrTamm. I can see that the git command is executed, which is good news. My diagnosis is that the way you have configured your repository root and your include paths is preventing the vcsLogDump task to correctly detect the git commits that refer to that file. This can be caused by the way the file paths are expressed. A way to confirm this is to manually run the git command as expressed in your debug output (git log --all --numstat --date=short --no-renames..., from your repo root folder and observe the output. You should see an output similar to

--e19d73792--2012-06-25--<user>
2       1       <file-path>
54     7      <file-path>
...

That <file-path> needs to match the criteria specified in your configuration, and I'm not sure it does. Possible solution:

rasmustam123 commented 4 years ago

Thanks, it's working now! We're using Lerna for multi-package repo so I had pointed rootPath to sub-package root directory. As running git commands from CLI works in child directories too, I didn't assume that was the problem. Pointed it to the root, root directory now.

smontanari commented 4 years ago

No worries, I'm glad I could help. I'm going to close the issue but thank you again for raising it. Although it wasn't ultimately a problem with the program it still highlighted the fact that under some conditions the log and error messages are not providing enough information for a quick resolution. I will see what can be done to improve that