-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[graal] Add support of Graal's CoCom Backend to ELK [File-level + Study] (WIP) #664
[graal] Add support of Graal's CoCom Backend to ELK [File-level + Study] (WIP) #664
Conversation
Add support of Graal's CoCom backend to ELK and it's corresponding tests Signed-off-by: inishchith <inishchith@gmail.com>
c44f4d4
to
96425ce
Compare
Pull Request Test Coverage Report for Build 1566
💛 - Coveralls |
Pull Request Test Coverage Report for Build 1547
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comments are similar to: #669 (review). In a nutshell, the approach looks good, however the study code in the cocom and colic enrichers seems really similar. It could be nice to abstract this logic in a new class (contained in a dedicated file) together with the queries. WDTY?
Thanks
96425ce
to
82c368a
Compare
Tasks
+ the first comment tasks |
cb01d31
to
2555cf1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @inishchith for the PR. It looks great, however some minor changes should be added.
I left some comments, please let me know what you think.
def __add_derived_metrics(self, file_analysis, eitem): | ||
""" Add derived metrics fields """ | ||
|
||
# TODO: Fix Logic: None rather than 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally the proportion is calculated based on LOC, thus the attributes should be funs/LOC, comments/LOC blanks/LOC. The code could be refactored as follows, WDYT?
loc = eitem.get('loc', None)
comments = eitem.get('comments', None)
functions = eitem.get('num_funs', None)
eitem["comment_lines_per_loc"] = None
eitem["blank_lines_per_loc"] = None
eitem["functions_per_loc"] = None
if loc:
eitem["comment_lines_per_loc"] = comments / loc if comments else None
eitem["blank_lines_per_loc"] = blanks / loc if blanks else None
eitem["functions_per_loc"] = functions / loc if functions else None
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@valeriocos I wanted to discuss this and get more clarity. ( the changes shouldn't take time so).
Generally the proportion is calculated based on LOC, thus the attributes should be funs/LOC, comments/LOC blanks/LOC.
- I had thought of adding
loc_per_(metric)
as for instance, it's easier to understand if we say there areX
lines of code per function ( which means in the corresponding file,each function has around X lines of code
). Similarly for comments and blanks. - Whereas the otherwise
functions_per_loc
would give us a result (in most of the case)less than 1
for instance,0.34 functions per line of code
. Would it make sense to have this information or the former? (Please correct me if I misunderstood something here 🙈 )
Let me know what you think :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's better to have what you propose, each function has around X lines of code
looks much more interesting as info. However, for comments and blank lines knowing each comment/blank lines has around X lines of code
sounds a bit strange, while 0.34 comments/blank lines per line of code
seems better. WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@valeriocos Thanks for the quick response :).
We can discuss more on this in the next meeting with @aswanipranjal and @jgbarah, and make necessary changes ( I'll keep this as unresolved until then )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure! I won't be in the next meeting (vacations)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@valeriocos Sorry for the delayed response.
Sure! I won't be in the next meeting (vacations)
Oh Okay!. As of now, I've made the changes. Thanks!
evolution_item["total_" + metric] = evolution_item.get("total_" + metric, 0) + file_details[metric] | ||
|
||
# TODO: Fix Logic: None rather than 1 | ||
evolution_item["total_loc_per_comment_lines"] = evolution_item["total_loc"] / \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would mimic the logic described in the comment of __add_derived_metrics
, WDYT?
2555cf1
to
fa0fbad
Compare
Signed-off-by: inishchith <inishchith@gmail.com>
fa0fbad
to
2cac375
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @inishchith . The PR looks perfect, I left a minor comment.
closing in reference to #672 |
Address: inishchith/gsoc#8
TODO:
NOTE:
Graal
module not being a part ofrequirements.txt
(dependencies) and is a part of this PR just to check the coverage of new additions.Signed-off-by: inishchith inishchith@gmail.com