Showing 84 of 185 total issues
Method getFilesToAnalyze
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public Set<String> getFilesToAnalyze() throws IOException, CLIArgumentParserException {
Optional<String> srcRoot = getSrcRoot();
List<String> pathNames = new ArrayList<>();
String[] cliPaths = cmd.getArgs();
Method addAllExpectedMsgs
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
protected void addAllExpectedMsgs() {
int start = 1;
addExpectedMsg(start, 18, Severity.WARNING, Messages.STATEMENTS);
addExpectedMsg(start + 5, 15, Severity.WARNING, Messages.STATEMENTS);
Method addAllExpectedMsgs
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
protected void addAllExpectedMsgs() {
int start = 3;
addExpectedMsg(start, 8, Severity.WARNING, Messages.CONDITION + Messages.ENCLOSED_PARENTHESES);
addExpectedMsg(start + 3, 13, Severity.WARNING, Messages.CONDITION + Messages.ENCLOSED_PARENTHESES);
Method enterFunctionCallExpression
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
@Override
public void enterFunctionCallExpression(FunctionCallExpressionContext ctx) {
FunctionCallArgumentListContext argumentList =
ctx.functionCallArgumentClause().functionCallArgumentList();
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method main
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static void main(String[] args) {
Tailor tailor = new Tailor();
try {
tailor.configuration = new Configuration(args);
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function play
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
func play() {
square = 0
delegate?.gameDidStart(self)
gameLoop: while square != finalSquare {
let diceRoll = dice.roll()
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method numberOfFilesBeforePurge
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public int numberOfFilesBeforePurge() throws CLIArgumentParserException {
if (CLIArgumentParser.shouldClearDFAs()) {
int purge = CLIArgumentParser.numberOfFilesBeforePurge();
if (purge >= 1) {
return purge;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method analyzeFile
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
private void analyzeFile(File inputFile,
Optional<CommonTokenStream> optTokenStream,
Optional<TopLevelContext> optTree,
Formatter formatter,
Severity maxSeverity,
Function blendFrameDstBytes
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
func blendFrameDstBytes(dstBytes: Array<UnsafeMutablePointer<UInt8>>,
srcBytes: Array<UnsafeMutablePointer<UInt8>>,
blendOP: UInt8,
offsetX: UInt32,
offsetY: UInt32,
Method verifyEnumBraceStyle
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private void verifyEnumBraceStyle(ParserRuleContext ctx) {
for (ParseTree child : ctx.children) {
if (child instanceof TerminalNodeImpl && child.getText().equals("{")) {
Token openBrace = ((TerminalNodeImpl) child).getSymbol();
Location openBraceLocation = ListenerUtil.getTokenLocation(openBrace);
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method evaluatePattern
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private void evaluatePattern(SwiftParser.PatternContext pattern) {
if (pattern.identifierPattern() != null) {
extractIdentifier(pattern.identifierPattern());
} else if (pattern.tuplePattern() != null && pattern.tuplePattern().tuplePatternElementList() != null) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method syntaxError
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public void syntaxError(Recognizer<?, ?> recognizer, Object offendingSymbol, int line, int charPositionInLine,
String msg, RecognitionException ex) {
Method addExpectedMsg
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
private void addExpectedMsg(Rules rule, int line, int column, String msg, int length,
int limit) {
Method createErrorMessage
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
protected void createErrorMessage(Rules rule, int constructLength, ParserRuleContext ctx, String constructType,
int length, String msg) {
Method getFilesToAnalyze
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public Set<String> getFilesToAnalyze() throws IOException, CLIArgumentParserException {
Optional<String> srcRoot = getSrcRoot();
List<String> pathNames = new ArrayList<>();
String[] cliPaths = cmd.getArgs();
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method verifyBlankLinesAroundFunction
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private void verifyBlankLinesAroundFunction(SwiftParser.FunctionDeclarationContext ctx) {
SwiftParser.DeclarationContext declCtx = (SwiftParser.DeclarationContext) ctx.getParent();
ParseTree left = ParseTreeUtil.getLeftNode(declCtx);
if (left != null) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method genOutputStringForTest
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public static String genOutputStringForTest(Rules rule, String filePath, int line, int column, Severity severity,
String msg) {
Consider simplifying this complex logical expression. Open
if (ctx == null
|| ctx.getChildCount() != 1
|| ctx.prefixExpression() == null
|| ctx.prefixExpression().prefixOperator() != null // flag cases with trailing ;
|| ctx.prefixExpression().postfixExpression() == null
Method addExpectedMsg
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
private void addExpectedMsg(Rules rule, int line, int column, Severity severity, String msg) {
Method addExpectedMsg
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
private void addExpectedMsg(Rules rule, int line, int column, Severity classification, String msg) {