Skip to content

Tests affect code density and reduce resulting score very much #339

@seroperson

Description

@seroperson

Description

Currently contributing the code with tests likely results into much-much reduced score because tests affect code density.

Just take any PR with tests and compare its' score with the same PR, but without tests.

For example, https://gittensor.io/miners/pr?repo=denoland%2Fdeno&number=33104 results into ~50 potential score
Removing tests from it, which are 252 of 330 total changed lines, makes this PR ~200 potential score

So, the given example has quadruple reduced score because of tests 🤡

Deleted files, unsupported extensions, binary files, and oversized files also contribute 0 to the score, but affect code density and resulting score very-very much.

Expected Behavior

The simplest fix would be just not counting tests to the changed lines, so they don't affect density. The better fix probably would be calculating test's score separately from production code, and then sum.

Also it would be good to address the same way the fact that other non-production code can dump your score because of code density. For example, in Paperclip project you're forced to generate a database schema snapshot when you add a migration. Such snapshot is approximately 10k lines json, which also dumps your code density to the ground, resulting into much-much lower score.

Test coverage must slightly improve your total score, but currently it literally kills it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions