Skip to content

Commit

Permalink
Extracting substring indexes to variables
Browse files Browse the repository at this point in the history
  • Loading branch information
dabico committed Oct 31, 2023
1 parent b8a6273 commit 6f541cb
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,9 @@ public int hashCode() {
@Override
public String toString() {
String original = node.toString();
String data = original.substring(5, original.length() - 1);
int lower = 5;

Check failure on line 292 in src/main/java/ch/usi/si/seart/treesitter/OffsetTreeCursor.java

View workflow job for this annotation

GitHub Actions / reviewdog

[reviewdog] src/main/java/ch/usi/si/seart/treesitter/OffsetTreeCursor.java#L292 <com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck>

'5' is a magic number.
Raw output
/github/workspace/./src/main/java/ch/usi/si/seart/treesitter/OffsetTreeCursor.java:292:25: error: '5' is a magic number. (com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck)
int upper = original.length() - 1;
String data = original.substring(lower, upper);
return String.format(
"OffsetNode(%s, row: %d, column: %d)",
data, offset.getRow(), offset.getColumn()
Expand Down

0 comments on commit 6f541cb

Please sign in to comment.