Skip to content

Commit

Permalink
Merge pull request #1255 from guwirth/grammar-warnings
Browse files Browse the repository at this point in the history
remove some SQ warnings
  • Loading branch information
guwirth authored Oct 18, 2017
2 parents 573d186 + acd229c commit 3db63f5
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 292 deletions.
284 changes: 0 additions & 284 deletions cxx-squid/src/main/java/org/sonar/cxx/api/CxxGrammar.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
/**
* Based on the C++ Standard, Appendix A
*/
@SuppressWarnings("squid:S00115")
public enum CxxGrammarImpl implements GrammarRuleKey {

// Misc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import com.sonar.sslr.api.AstNodeType;
import com.sonar.sslr.api.Grammar;
import org.sonar.cxx.api.CxxKeyword;
import org.sonar.cxx.api.CxxMetric;
import org.sonar.cxx.api.CxxPunctuator;
import org.sonar.cxx.parser.CxxGrammarImpl;
import org.sonar.squidbridge.SquidAstVisitor;
Expand All @@ -44,7 +43,7 @@
public final class CxxCognitiveComplexityVisitor<G extends Grammar> extends SquidAstVisitor<G> {

private final MetricDef metric;
private Set<AstNodeType> astNodeTypes;
private final Set<AstNodeType> astNodeTypes;

public static final class Builder<G extends Grammar> {

Expand All @@ -60,9 +59,7 @@ public Builder<G> setMetricDef(MetricDef metric) {
}

public Builder<G> subscribeTo(AstNodeType... astNodeTypes) {
for (AstNodeType astNodeType : astNodeTypes) {
this.astNodeTypes.add(astNodeType);
}
this.astNodeTypes.addAll(Arrays.asList(astNodeTypes));
return this;
}

Expand All @@ -72,7 +69,7 @@ public Builder<G> subscribeTo(Collection<AstNodeType> astNodeTypes) {
}

public CxxCognitiveComplexityVisitor<G> build() {
return new CxxCognitiveComplexityVisitor<G>(this);
return new CxxCognitiveComplexityVisitor<>(this);
}

}
Expand Down Expand Up @@ -128,7 +125,7 @@ private CxxCognitiveComplexityVisitor(Builder<G> builder) {
}

public static <G extends Grammar> Builder<G> builder() {
return new Builder<G>();
return new Builder<>();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
import org.sonar.squidbridge.SquidAstVisitorContext;

import com.sonar.sslr.api.GenericTokenType;
//import org.sonar.cxx.api.CxxGrammar;
import com.sonar.sslr.api.Grammar;
import com.sonar.sslr.api.Token;
import com.sonar.sslr.impl.Lexer;
Expand Down

0 comments on commit 3db63f5

Please sign in to comment.