Showing 84 of 185 total issues
Method genOutputStringForTest
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public static String genOutputStringForTest(String filePath, int line, int column, Severity severity, String msg) {
Method addExpectedLineMsg
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
private void addExpectedLineMsg(int line, int column, String msg, int length, int limit) {
Method validateViolationMessage
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
private void validateViolationMessage(ViolationMessage message, Rules rule, String msg,
int line, int column) {
Method addExpectedMsg
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
private void addExpectedMsg(Rules rule, int line, int column, Severity classification, String msg) {
Method lineLengthViolation
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
private void lineLengthViolation(int lineNumber, int lineLength, int lengthLimit, Rules rule, String msg) {
Method addExpectedNameMsg
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
private void addExpectedNameMsg(int line, int column, String msg, int length, int limit) {
Method addExpectedMsg
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
private void addExpectedMsg(Rules rule, int line, String msg, int length, int limit) {
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 severity, String msg) {
Method genOutputStringForTest
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public static String genOutputStringForTest(Rules rule, String filePath, int line, Severity severity, String msg) {
Method compareTo
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
@Override
public int compareTo(final ViolationMessage message) {
int ret = this.lineNumber - message.lineNumber;
if (ret == 0) {
ret = this.columnNumber - message.columnNumber;
- 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 extractComments
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private void extractComments() {
for (Token token : tokenStream.getTokens()) {
if (token.getChannel() != Token.HIDDEN_CHANNEL) {
continue;
}
- 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 equals
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
- 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 getEnabledRules
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public Set<Rules> getEnabledRules() throws CLIArgumentParserException {
// --only is given precedence over --except
// CLI input is given precedence over YAML configuration file
// Retrieve included or excluded rules from CLI
- 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
Avoid too many return
statements within this method. Open
return;
Avoid too many return
statements within this method. Open
return new HashSet<>(Arrays.asList(Rules.values()));
Avoid too many return
statements within this method. Open
return;
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 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"