Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove some SQ warnings #1255

Merged
merged 1 commit into from
Oct 18, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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