Showing 84 of 185 total issues
Method formattedSeverity
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private String formattedSeverity() {
String res;
if (colorSettings.colorOutput) {
res = String.format("%7s:", severity);
if (severity.equals(Severity.ERROR)) {
- 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 enterFunctionCallArgument
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
@Override
public void enterFunctionCallArgument(SwiftParser.FunctionCallArgumentContext ctx) {
if (ctx.functionCallIdentifier() != null) {
Token colon = ((TerminalNodeImpl) ctx.getChild(1)).getSymbol();
Token left = ctx.functionCallIdentifier().getStop();
- 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 enterOperatorDeclaration
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
@Override
public void enterOperatorDeclaration(SwiftParser.OperatorDeclarationContext ctx) {
for (int i = 0; i < ctx.getChild(0).getChildCount(); i++) {
if (ctx.getChild(0).getChild(i) instanceof SwiftParser.OperatorContext) {
SwiftParser.OperatorContext op = (SwiftParser.OperatorContext) ctx.getChild(0).getChild(i);
- 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 getConstantDeclaration
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static ParserRuleContext getConstantDeclaration(ParserRuleContext ctx) {
if (ctx.getParent() != null) {
if (ctx.getParent() instanceof SwiftParser.ConstantDeclarationContext) {
return ctx.getParent();
} else {
- 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"