jshaptic/minimatch-javaport

View on GitHub

Showing 41 of 78 total issues

Rename "options" which hides the field declared at line 132.
Open

int options = this.options;

Replace this use of System.out or System.err by a logger.
Open

System.out.format("%s: ", Thread.currentThread().getStackTrace()[2].getLineNumber());

Define and throw a dedicated exception instead of using a generic one.
Open

throw new RuntimeException("wtf?");

Rename "pattern" which hides the field declared at line 134.
Open

String pattern = this.pattern;

Refactor this method to reduce its Cognitive Complexity from 55 to the 15 allowed.
Open

private boolean matchOne(String[] file, MinimatchPattern[] pattern, boolean partial) {

A "NullPointerException" could be thrown; "asPattern()" can return null.
Open

hit = p.isPattern() && p.asPattern().matcher(f).matches();

Replace this use of System.out or System.err by a logger.
Open

System.out.format(logline + "\n", vars);

Extract this nested ternary operation into an independent statement.
Open

String t = pl.type == '*' ? STAR : pl.type == '?' ? QMARK : "\\" + pl.type;

Rename "options" which hides the field declared at line 132.
Open

int options = this.options;

Rename "set" which hides the field declared at line 133.
Open

MinimatchPattern[][] set = this.set;

Refactor this method to reduce its Cognitive Complexity from 24 to the 15 allowed.
Open

public static RangePair range(String a, String b, String str) {

This block of commented-out lines of code should be removed.
Open

// this module is to match Bash's rules, we escape a leading {}

Define a constant instead of duplicating this literal "pre{{{in}}}post" 4 times.
Open

BalancedMatch.balanced("{{", "}}", "pre{{{in}}}post");

Extract this nested ternary operation into an independent statement.
Open

: hasOption(options, DOT) ? "(?!(?:^|\\/)\\.{1,2}(?:$|\\/))" : "(?!\\.)";

Replace this use of System.out or System.err by a logger.
Open

System.out.format("%s: ", Thread.currentThread().getStackTrace()[2].getLineNumber());

Rename "options" which hides the field declared at line 132.
Open

int options = this.options;

Define and throw a dedicated exception instead of using a generic one.
Open

throw new RuntimeException("pattern is too long");

Rename "pattern" which hides the field declared at line 134.
Open

String pattern = this.pattern;

Rename "negate" which hides the field declared at line 137.
Open

boolean negate = false;

Rename "set" which hides the field declared at line 133.
Open

MinimatchPattern[][] set = new MinimatchPattern[globParts.length][];
Severity
Category
Status
Source
Language