joshsoftware / joshsoftware/code-curiosity

Commit Scoring Logic

Open
#129 4 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Ruby
Stars
87
Forks
57
PR merge metrics
No merged PRs in 30d

Description

Currently while scoring commits bugspots is used and in bugspot each file is rated based on historical commit messages on that file and timestamp of commit message. File whose historical commit message has [max number of "fix" or "close" word](https://github.com/igrigorik/bugspots/blob/master/lib/bugspots/scanner.rb) gets higher weightage.

Incase of `aasm` highest weightage is for README and also CHANGELOG has higher weightage.

``` ruby
Hotspots:
5.9860 - README.md
2.5098 - lib/aasm/core/transition.rb
2.5010 - lib/aasm/instance_base.rb
1.9753 - spec/unit/transition_spec.rb
1.9007 - lib/aasm/persistence/active_record_persistence.rb
1.7792 - lib/aasm/base.rb
1.6691 - spec/unit/inspection_spec.rb
1.5949 - lib/generators/active_record/templates/migration_existing.rb
1.5705 - CHANGELOG.md
```

Incase of `mongoid` highest weightage is to CHANGELOG

``` ruby
Hotspots:
2.9300 - CHANGELOG.md
0.8669 - lib/mongoid/contextual/mongo.rb
0.7303 - spec/mongoid/scopable_spec.rb
0.7236 - lib/mongoid/scopable.rb
0.7053 - lib/mongoid/persistable/settable.rb
```
- [Here](https://github.com/joshsoftware/code-curiosity/blob/master/app/models/scoring_engine.rb#L76) while calculating score bugspot_score of file is used so if person do typo fix in readme update gets higher score than actual code changes incase of aasm.
- If person adds totally new file for some feature will get 0 marks as `bugspots_scores[file.filename]` will be 0
- [Here](https://github.com/joshsoftware/code-curiosity/blob/master/app/models/scoring_engine.rb#L84) `total_score` is divided by `number_of_files in the commit` so if user has done good change and if test case file has less weightage then that commit will be scored less. If person commits test cases seperately and code seperately he will get more marks than person commiting both things together. but I think this can't be handled.

Thoughts?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.