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 getNumberOfBlankLines
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private static int getNumberOfBlankLines(List<Token> tokens) {
if (tokens == null || tokens.size() <= 1) {
return 0;
}
- 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 getFormat
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private Format getFormat() throws CLIArgumentParserException, YAMLException {
// Try to get format from CLI/config file. Else use the default format (XCODE)
Format format = Format.XCODE;
if (CLIArgumentParser.formatOptionSet()) {
format = CLIArgumentParser.getFormat();
- 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"