JanusGraph / JanusGraph/janusgraph

Automated incorrect code pattern discovery / source code rewriting

Open
#527 0 comments 0 reactions 0 assignees View on GitHub
static-analysis
Dominant language
Java
Stars
5.8k
Forks
1.2k
Avg merge
13h 53m
Merged PRs (30d)
6

Description

This is somewhat related to issue #9 but I think it's sufficiently distinct to warrant its own issue.

Another thing to consider is finding common patterns that need to be fixed and alerting on them (as a test, so it's caught at review time) as well as a mass-rewriter to bring the code base into compliance easily.

One candidate: `assertEquals()` parameter ordering is easy to get wrong: the first parameter is the _expected value_, the second parameter is the _actual value_. Reversing them does not change the result of equality comparison, but it does make for some very confusing error messages, because the text output assumes that the first parameter is "expected" and the second is "actual".

Some options for this work:

* http://errorprone.info/docs/refaster ([paper](https://research.google.com/pubs/pub41876.html))
* https://github.com/Netflix-Skunkworks/rewrite

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the proposed assertEquals parameter-ordering pattern and the referenced Error Prone Refaster and Netflix Rewrite projects. Define the discovery, review-time alerting, and mass-rewriting scope before choosing an approach; done means the agreed patterns can be detected and the codebase can be brought into compliance safely.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
testing, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.