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

Dead stores should be removed #160

Merged
merged 1 commit into from
May 2, 2016
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
2 changes: 1 addition & 1 deletion src/main/java/com/cflint/CFLint.java
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,7 @@ protected void reportRule(final Element elem, final Object expression, final Con
if(configuration == null){
throw new NullPointerException("Configuration is null");
}
PluginInfoRule ruleInfo = null;
PluginInfoRule ruleInfo;
if("PLUGIN_ERROR".equals(msgcode)){
ruleInfo = new PluginInfoRule();
PluginMessage msgInfo = new PluginMessage("PLUGIN_ERROR");
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/cflint/HTMLOutput.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public void output(final BugList bugList, final Writer writer, final boolean sho

// 2. Use the TransformerFactory to process the stylesheet Source and
// generate a Transformer.
javax.xml.transform.Transformer transformer = null;
javax.xml.transform.Transformer transformer;
//System.out.println("Using html style:" + htmlStyle);
try {
final InputStream is = getClass().getResourceAsStream("/findbugs/" + htmlStyle);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/cflint/JSONOutput.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public void output(final BugList bugList, final Writer writer, final boolean sho
for (final Entry<String, List<BugInfo>> bugEntry : bugList.getBugList().entrySet()) {
final Iterator<BugInfo> iterator = bugEntry.getValue().iterator();
BugInfo bugInfo = iterator.hasNext() ? iterator.next() : null;
BugInfo prevbugInfo = null;
BugInfo prevbugInfo;

while (bugInfo != null) {
String severity = bugEntry.getValue().get(0).getSeverity();
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/cflint/XMLOutput.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public void output(final BugList bugList, final Writer writer, final boolean sho
for (final Entry<String, List<BugInfo>> bugEntry : bugList.getBugList().entrySet()) {
final Iterator<BugInfo> iterator = bugEntry.getValue().iterator();
BugInfo bugInfo = iterator.hasNext() ? iterator.next() : null;
BugInfo prevbugInfo = null;
BugInfo prevbugInfo;

while (bugInfo != null) {
String severity = bugEntry.getValue().get(0).getSeverity();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ public void expression(final CFScriptStatement expression, final Context context
String decompile = function.Decompile(1);
final int begLine = function.getLine();
String[] lines = decompile.split("\\n");
CFCompoundStatement body = (CFCompoundStatement) function.getBody();

checkSize(context, begLine, lines.length, bugs);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class SimpleComplexityChecker extends CFLintScannerAdapter {

@Override
public void expression(final CFScriptStatement expression, final Context context, final BugList bugs) {
CFFuncDeclStatement function = null;
CFFuncDeclStatement function;

if (expression instanceof CFFuncDeclStatement) {
function = (CFFuncDeclStatement) expression;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ public void expression(final CFScriptStatement expression, final Context context
alreadyTooMany = false;
}
else if (expression instanceof CFFuncDeclStatement) {
final CFFuncDeclStatement function = (CFFuncDeclStatement) expression;

if (!trivalFunction(context.getFunctionName())) {
functionCount++;
Expand Down