Last week, we had thought to provide analysis(visualization) of changes over a period of time(configurable) for attributes such as ccn (code complexity), loc (lines of code), num_funs (number of functions), tokens (number of tokens) which are produced by Graal’s CoCom Backend.
So for this week, My task revolved around working on some reference visualization and to conduct some discussion related to the requirement in the issue thread - inishchith/gsoc-graal#6): [discussion] Considering relevant attributes from Graal for Visualization
- In order to provide some context, Graal's CoCom backend would provide us analysis data for each file that is affected in a commit. (shown below)
analysis = [
...
{
"ccn": 19,
"avg_ccn": 2.111111111111111,
"avg_loc": 9.11111111111111,
"avg_tokens": 64,
"num_funs": 9,
"loc": 129,
"tokens": 786,
"ext": "py",
"blanks": 48,
"comments": 63,
"file_path": "graal/codecomplexity.py"
}
...
]
At this point, We need to keep track of files(and their analysis data) that are available after each checkout commit and calculate the sum of the attributes, in order to produce some insights related to (for eg.) Total Code Complexity (and others) of the Software repository.
-
Fortunately, @valcos had shared some reference implementation of the above idea and agreed to the fact that we had to maintained separate items in the enriched index for each file's analysis data that is available in the raw index. (We had exchanged some implementation in the course of the week in the corresponding working branch, and yesterday @valcos had made some improvements to the code wrt. to the redundancy in the insertion of items)
-
[ BLOCKER ] Now, the idea was a lot clear but there was still work to be done from configuring visualization in Kibana and get it working according to the discussed idea (i.e point 1). I couldn't find a way to implement the idea for (variable number of) files available after a point in time, though the latter part was easier to implement (calculating the sum total of the particular analysis attribute eg. ccn).
-
In order to utilize the time, I proposed an idea of repository-level analysis in an issue thread which was basically producing repository-level analysis as an option for CoCom Backend, which would make the visualization to be carried out in Kibana in a bit easier way. (below are some comparison)
Repository Number of Commits File Level Repository Level coala/coala 4458 58.89 min 59.92 min grimoirelab-perceval 1387 24.83 min 26.63 min grimoirelab-graal 169 1.82 min 1.86 min
- I felt this would be a good-to-have option in
Graal
and as I've mentioned in the comment, would make it easier to visualize the data in Kibana. Hence, I've worked on the repository level analysis and could produce the following results.
Repository: chaoss/grimoirelab-perceval
-
I feel the above can be further improved after getting some more clarity and having a discussion with the mentors in today's meeting :)
-
Pull request created
- chaoss/grimoirelab-graal#37): [analyzer] Fix results for deleted files for CoCom backend
- chaoss/grimoirelab-graal#38: [cocom] Add repository level analysis option for CoCom backend
-
Issues opened
- chaoss/grimoirelab-graal#35: [analyzer] Fix results for deleted files
- chaoss/grimoirelab-graal#36: [cocom] Evaluating results with repository level analysis