diff --git a/RULES.md b/RULES.md index a48dbf22c..793f7eece 100644 --- a/RULES.md +++ b/RULES.md @@ -96,7 +96,7 @@ QueryNew statement should specify data types. **Severity**: WARNING -**Message**: QueryNew statement should specify datatypes. +**Message**: QueryNew statement should specify data types. ### VarScoper @@ -230,7 +230,7 @@ Argument is missing a hint. **Severity**: INFO -**Message**: Argument *variable* is missing a hint. Use javadoc style annotations on cfscript functions. +**Message**: Argument *variable* is missing a hint. Use Javadoc style annotations on cfscript functions. ### ArgumentTypeChecker @@ -392,7 +392,7 @@ Avoid use of arrayNew statements. Use [] instead. **Severity**: INFO -**Message**: Use implict array construction instead (= []). +**Message**: Use implicit array construction instead (= []). ### ComplexBooleanExpressionChecker @@ -720,7 +720,7 @@ CFM File starts with upper case. #### AVOID_USING_CREATEOBJECT -Avoid use of creatObject statements. +Avoid use of createObject statements. **Severity**: INFO diff --git a/pom.xml b/pom.xml index e837e7f37..d730661a6 100644 --- a/pom.xml +++ b/pom.xml @@ -301,93 +301,93 @@ deploy - - - org.apache.maven.plugins - maven-source-plugin - 2.4 - - - attach-sources - - jar - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - 2.10.1 - - - attach-javadocs - - jar - - - - - - org.apache.maven.plugins - maven-gpg-plugin - 1.5 - - - sign-artifacts - verify - - sign - - - - - - org.codehaus.mojo - license-maven-plugin - 1.8 - - false - true - - - - first - - update-file-header - - process-sources + + + org.apache.maven.plugins + maven-source-plugin + 2.4 + + + attach-sources + + jar + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.10.1 + + + attach-javadocs + + jar + + + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.5 + + + sign-artifacts + verify + + sign + + + + + + org.codehaus.mojo + license-maven-plugin + 1.8 - bsd_2 - - src/main/java - src/test - - - *.java - - - cfml.dictionary* - + false + true - - - - - org.sonatype.plugins - nexus-staging-maven-plugin - 1.6.5 - true - - ossrh - https://oss.sonatype.org/ - false - - - - - - + + + first + + update-file-header + + process-sources + + bsd_2 + + src/main/java + src/test + + + *.java + + + cfml.dictionary* + + + + + + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.5 + true + + ossrh + https://oss.sonatype.org/ + false + + + + + + diff --git a/src/main/java/com/cflint/CF.java b/src/main/java/com/cflint/CF.java index d91cd8ba0..09b50bcd4 100644 --- a/src/main/java/com/cflint/CF.java +++ b/src/main/java/com/cflint/CF.java @@ -37,7 +37,7 @@ public class CF { public static final String CFDBINFO = "cfdbinfo"; /** - * CFDeafulatCase Tag. + * CFDefaultCase Tag. */ public static final String CFDEFAULTCASE = "cfdefaultcase"; @@ -195,7 +195,7 @@ public class CF { public static final String CFQUERYPARAM = "cfqueryparam"; /** - * CFRegistory Tag. + * CFRegistry Tag. */ public static final String CFREGISTRY = "cfregistry"; @@ -451,7 +451,7 @@ public class CF { public static final String ARGUMENTS = "arguments"; /** - * CF scope cthread. + * CF scope cfthread. */ public static final String CFTHREAD= "cfthread"; diff --git a/src/main/java/com/cflint/cli/CFLintCLI.java b/src/main/java/com/cflint/cli/CFLintCLI.java index 0d1607464..0a8eec1c8 100644 --- a/src/main/java/com/cflint/cli/CFLintCLI.java +++ b/src/main/java/com/cflint/cli/CFLintCLI.java @@ -82,8 +82,8 @@ public static void main(final String[] args) throws Exception { Option optionSTRICT_INCLUDE = new Option(Settings.STRICT_INCLUDE, false, "Check every include and try to parse it"); Option optionLOGERROR = new Option(Settings.LOGERROR, false, "log parsing errors as bugs"); Option optionE = new Option(Settings.E, false, "log parsing errors as bugs"); - Option optionQUIET = new Option(Settings.QUIET, false, "quiet mode surpresses most linting error and commentary output"); - Option optionQ = new Option(Settings.Q, false, "quiet mode surpresses most linting error and commentary output"); + Option optionQUIET = new Option(Settings.QUIET, false, "quiet mode suppresses most linting error and commentary output"); + Option optionQ = new Option(Settings.Q, false, "quiet mode suppresses most linting error and commentary output"); Option optionDEBUG = new Option(Settings.DEBUG, false, "debug-level output during linting"); Option optionD = new Option(Settings.D, false, "debug-level output during linting"); Option optionHELP = new Option(Settings.HELP, false, DISPLAY_THIS_HELP); diff --git a/src/main/java/com/cflint/cli/Settings.java b/src/main/java/com/cflint/cli/Settings.java index 341b9a3a5..ab3f723f2 100644 --- a/src/main/java/com/cflint/cli/Settings.java +++ b/src/main/java/com/cflint/cli/Settings.java @@ -12,12 +12,12 @@ public class Settings { public static final String V = "v"; /** - * quiet mode surpresses most linting error and commentary output + * quiet mode suppresses most linting error and commentary output */ public static final String QUIET = "quiet"; /** - * quiet mode surpresses most linting error and commentary output + * quiet mode suppresses most linting error and commentary output */ public static final String Q = "q"; @@ -182,7 +182,7 @@ public class Settings { public static final String H = "h"; /** - * List all rules orgered via teh groups they are in. + * List all rules ordered via the groups they are in. */ public static final String LIST_RULE_GROUPS = "listrulegroups"; diff --git a/src/main/java/com/cflint/config/BaseConfig.java b/src/main/java/com/cflint/config/BaseConfig.java index 420151623..feb60f914 100644 --- a/src/main/java/com/cflint/config/BaseConfig.java +++ b/src/main/java/com/cflint/config/BaseConfig.java @@ -11,7 +11,7 @@ public abstract class BaseConfig implements CFLintConfiguration{ /** * get the string property from the configuration. - * This can be overriden with -DcheckerClass.propertyname=value + * This can be overridden with -DcheckerClass.propertyname=value * * @param linter instance of current CFLintScanner plugin * @param name the name of the parameter @@ -42,7 +42,7 @@ public String getParameter(final CFLintScanner linter, final String name) { /** * get the string property from the configuration. If it is null return empty string. - * This can be overriden with -DcheckerClass.propertyname=value + * This can be overridden with -DcheckerClass.propertyname=value * * @param linter instance of current CFLintScanner plugin * @param name the name of the parameter @@ -59,7 +59,7 @@ public String getParameterNotNull(final CFLintScanner linter, final String name) /** * get the property from the configuration. - * This can be overriden with -DcheckerClass.propertyname=value + * This can be overridden with -DcheckerClass.propertyname=value * * @param linter instance of current CFLintScanner plugin * @param name the name of the parameter diff --git a/src/main/java/com/cflint/config/CFLintConfiguration.java b/src/main/java/com/cflint/config/CFLintConfiguration.java index b51c444ca..981cba1bc 100644 --- a/src/main/java/com/cflint/config/CFLintConfiguration.java +++ b/src/main/java/com/cflint/config/CFLintConfiguration.java @@ -21,10 +21,10 @@ public interface CFLintConfiguration { void addExclude(PluginMessage pluginMessage); Collection getRules(); - + /** * get the property from the configuration. - * This can be overriden with -DcheckerClass.propertyname=value + * This can be overridden with -DcheckerClass.propertyname=value * * @param name the name of the parameter * @return the value of the parameter diff --git a/src/main/java/com/cflint/plugins/CFLintScannerAdapter.java b/src/main/java/com/cflint/plugins/CFLintScannerAdapter.java index a6d7b4c73..21558d1f0 100644 --- a/src/main/java/com/cflint/plugins/CFLintScannerAdapter.java +++ b/src/main/java/com/cflint/plugins/CFLintScannerAdapter.java @@ -60,7 +60,7 @@ public void setParameter(final String name, final Object value) { /** * @deprecated - Use context.getConfiguration().getParameter() * get the property from the configuration. - * This can be overriden with -DcheckerClass.propertyname=value + * This can be overridden with -DcheckerClass.propertyname=value * * @param name the name of the parameter * @return the value of the parameter diff --git a/src/main/java/com/cflint/plugins/CFLintStructureListener.java b/src/main/java/com/cflint/plugins/CFLintStructureListener.java index bddef2cf9..70a54d377 100644 --- a/src/main/java/com/cflint/plugins/CFLintStructureListener.java +++ b/src/main/java/com/cflint/plugins/CFLintStructureListener.java @@ -3,16 +3,16 @@ import com.cflint.BugList; /** - * This interface supports plugins recieving structure notifications (file + * This interface supports plugins receiving structure notifications (file * start/end, component start/end, function start/end). * - * Normally it is used for initialization or summarization types of behaviours. + * Normally it is used for initialization or summarization types of behaviors. */ public interface CFLintStructureListener { /** * Called when processing of a new file has started - * + * * @param fileName * Name of the file that started * @param bugs @@ -22,7 +22,7 @@ public interface CFLintStructureListener { /** * Called when processing of current file has ended - * + * * @param fileName * Name of the file that finished * @param bugs @@ -32,7 +32,7 @@ public interface CFLintStructureListener { /** * Called when processing a new component has started - * + * * @param context * Current context * @param bugs @@ -42,7 +42,7 @@ public interface CFLintStructureListener { /** * Called when processing of current component has ended - * + * * @param context * Current context * @param bugs @@ -52,7 +52,7 @@ public interface CFLintStructureListener { /** * Called when processing of a new function has started - * + * * @param context * Current context * @param bugs @@ -62,7 +62,7 @@ public interface CFLintStructureListener { /** * Called when processing of current function has ended - * + * * @param context * Current context * @param bugs diff --git a/src/main/java/com/cflint/plugins/Context.java b/src/main/java/com/cflint/plugins/Context.java index 5483f192d..0d0308ac0 100644 --- a/src/main/java/com/cflint/plugins/Context.java +++ b/src/main/java/com/cflint/plugins/Context.java @@ -317,7 +317,7 @@ public Context subContextCFML(final Element elem, final CFExpression pseudoCfmlE context2.inStructKeyExpression=inStructKeyExpression; return context2; } - + public Context subContextInAssignment() { return subContextInAssignment(true); } @@ -346,7 +346,7 @@ public int offset() { } else if (element.getName().equalsIgnoreCase(CF.CFSET)) { return element.getStartTag().getTagContent().getBegin() + 1; } - + return element.getBegin(); } else { return 0; @@ -356,13 +356,13 @@ public int offset() { protected String componentFromFile(final String filename) { final int dotPosition = filename.lastIndexOf('.'); final String separator = System.getProperty("file.separator"); - final int seperatorPosition = filename.lastIndexOf(separator); + final int separatorPosition = filename.lastIndexOf(separator); - if (dotPosition == -1 || seperatorPosition == -1) { + if (dotPosition == -1 || separatorPosition == -1) { return null; } - return filename.substring(seperatorPosition + 1, dotPosition); + return filename.substring(separatorPosition + 1, dotPosition); } public CommonTokenStream getTokens() { @@ -435,7 +435,7 @@ public Context getParent() { } /** - * + * * @param type the type of context to retrieve from the parent tree * @return the parent context of the given type OR the root context if none * matches diff --git a/src/main/java/com/cflint/plugins/core/ArgHintChecker.java b/src/main/java/com/cflint/plugins/core/ArgHintChecker.java index e73c6293d..94f26ad4f 100644 --- a/src/main/java/com/cflint/plugins/core/ArgHintChecker.java +++ b/src/main/java/com/cflint/plugins/core/ArgHintChecker.java @@ -48,7 +48,7 @@ public void expression(final CFScriptStatement expression, final Context context final String multiLineText = PrecedingCommentReader.getMultiLine(context, expression.getToken()); final String mlText = multiLineText == null ? null : multiLineText.replaceFirst("^/\\*", "").replaceAll("\\*/$", "").trim(); - + final Map annotations = new HashMap<>(); if (mlText != null && !mlText.isEmpty()) { readCommentAnnotations(mlText, annotations); @@ -66,7 +66,7 @@ public void expression(final CFScriptStatement expression, final Context context * Parse a function comment to see if there are any argument annotations. * * @param mlText multi line text to search for argument hints in comments. - * @param annotations function argumnet hints. + * @param annotations function argument hints. */ private void readCommentAnnotations(final String mlText, final Map annotations) { final Pattern pattern = Pattern.compile("^.*\\s*@(\\w+)\\s+(.*+)$"); diff --git a/src/main/java/com/cflint/plugins/core/CFSwitchDefaultChecker.java b/src/main/java/com/cflint/plugins/core/CFSwitchDefaultChecker.java index 3e608c718..78f3f8213 100644 --- a/src/main/java/com/cflint/plugins/core/CFSwitchDefaultChecker.java +++ b/src/main/java/com/cflint/plugins/core/CFSwitchDefaultChecker.java @@ -17,7 +17,6 @@ public class CFSwitchDefaultChecker extends CFLintScannerAdapter { @Override public void expression(final CFScriptStatement expression, final Context context, final BugList bugs) { - // see if expression is cfSwithStatement if (expression instanceof CFSwitchStatement) { final CFSwitchStatement switchStatement = (CFSwitchStatement) expression; final String statement = switchStatement.Decompile(0).replace(" ", "").toLowerCase(); diff --git a/src/main/java/com/cflint/plugins/core/ComponentNameChecker.java b/src/main/java/com/cflint/plugins/core/ComponentNameChecker.java index 720173bfd..0a0b8ae8d 100644 --- a/src/main/java/com/cflint/plugins/core/ComponentNameChecker.java +++ b/src/main/java/com/cflint/plugins/core/ComponentNameChecker.java @@ -62,10 +62,10 @@ public void element(final Element element, final Context context, final BugList private String actualFileName(final String fileName) { String actualFileName = fileName; final String separator = System.getProperty("file.separator"); - final int seperatorPosition = fileName.lastIndexOf(separator); + final int separatorPosition = fileName.lastIndexOf(separator); - if (seperatorPosition >= 0) { - actualFileName = fileName.substring(seperatorPosition + 1); + if (separatorPosition >= 0) { + actualFileName = fileName.substring(separatorPosition + 1); } return actualFileName; diff --git a/src/main/java/com/cflint/plugins/core/CreateObjectChecker.java b/src/main/java/com/cflint/plugins/core/CreateObjectChecker.java index 6884eba0a..0c39ae8a3 100644 --- a/src/main/java/com/cflint/plugins/core/CreateObjectChecker.java +++ b/src/main/java/com/cflint/plugins/core/CreateObjectChecker.java @@ -18,12 +18,12 @@ public void expression(final CFScriptStatement expression, final Context context final int lineNo = ((CFExpressionStatement) expression).getLine() + context.startLine() - 1; final int offset = ((CFExpressionStatement) expression).getOffset() + context.offset(); if (code.toLowerCase().contains("createobject('component'")) { - noNeedtoUseCreateObject(lineNo, offset, context); + noNeedToUseCreateObject(lineNo, offset, context); } } } - protected void noNeedtoUseCreateObject(final int lineNo, final int offset, final Context context) { + protected void noNeedToUseCreateObject(final int lineNo, final int offset, final Context context) { context.addMessage("AVOID_USING_CREATEOBJECT", null, lineNo, offset); } } diff --git a/src/main/java/com/cflint/plugins/core/FileCaseChecker.java b/src/main/java/com/cflint/plugins/core/FileCaseChecker.java index 03ac7404b..c05433eb1 100644 --- a/src/main/java/com/cflint/plugins/core/FileCaseChecker.java +++ b/src/main/java/com/cflint/plugins/core/FileCaseChecker.java @@ -13,10 +13,10 @@ public class FileCaseChecker extends CFLintScannerAdapter { public void startFile(final String fileName, final BugList bugs) { String actualFileName = fileName; final String separator = System.getProperty("file.separator"); - final int seperatorPosition = fileName.lastIndexOf(separator); + final int separatorPosition = fileName.lastIndexOf(separator); - if (seperatorPosition >= 0) { - actualFileName = fileName.substring(seperatorPosition + 1); + if (separatorPosition >= 0) { + actualFileName = fileName.substring(separatorPosition + 1); } if (actualFileName.contains(".cfm")) { diff --git a/src/main/java/com/cflint/plugins/core/FunctionXChecker.java b/src/main/java/com/cflint/plugins/core/FunctionXChecker.java index f21260d5d..c98b7160a 100644 --- a/src/main/java/com/cflint/plugins/core/FunctionXChecker.java +++ b/src/main/java/com/cflint/plugins/core/FunctionXChecker.java @@ -17,8 +17,8 @@ public class FunctionXChecker extends CFLintScannerAdapter { /** * Check an CF expression for use of function X. * - * @param expression expresison to check. - * @param context expresion context. + * @param expression expression to check. + * @param context expression context. * @param bugs list of bugs. */ @Override diff --git a/src/main/java/com/cflint/plugins/core/LengthChecker.java b/src/main/java/com/cflint/plugins/core/LengthChecker.java index 9732d13b3..3da89d8a3 100644 --- a/src/main/java/com/cflint/plugins/core/LengthChecker.java +++ b/src/main/java/com/cflint/plugins/core/LengthChecker.java @@ -12,7 +12,7 @@ public class LengthChecker extends CFLintScannerAdapter { /** * Check the length of a block of code. * - * @param maxLength maximimum length. + * @param maxLength maximum length. * @param message message to display. * @param context current context. * @param atLine current line. diff --git a/src/main/java/com/cflint/plugins/core/LiteralChecker.java b/src/main/java/com/cflint/plugins/core/LiteralChecker.java index e19ed3e98..0e311b253 100644 --- a/src/main/java/com/cflint/plugins/core/LiteralChecker.java +++ b/src/main/java/com/cflint/plugins/core/LiteralChecker.java @@ -22,7 +22,7 @@ public class LiteralChecker extends CFLintScannerAdapter { protected int warningThreshold = WARNING_THRESHOLD; protected Map globalLiterals = new HashMap<>(); - protected Map functionListerals = new HashMap<>(); + protected Map functionLiterals = new HashMap<>(); // May want to consider resetting literal map on new components but this way // it detects duplicated literals across files which is useful @@ -55,7 +55,7 @@ public void expression(final CFExpression expression, final Context context, fin if ((warningScope == null || "global".equals(warningScope)) && !context.isInFunction()) { literalCount(name, lineNo, offset, globalLiterals, true, context, bugs,expression); } else if ("local".equals(warningScope) && context.isInFunction()) { - literalCount(name, lineNo, offset, functionListerals, false, context, bugs,expression); + literalCount(name, lineNo, offset, functionLiterals, false, context, bugs,expression); } } } @@ -63,7 +63,7 @@ public void expression(final CFExpression expression, final Context context, fin @Override public void expression(final CFScriptStatement expression, final Context context, final BugList bugs) { if (expression instanceof CFCompDeclStatement) { - functionListerals.clear(); + functionLiterals.clear(); } } diff --git a/src/main/java/com/cflint/plugins/core/QueryNewChecker.java b/src/main/java/com/cflint/plugins/core/QueryNewChecker.java index c2ccb839d..f0a63e9e5 100644 --- a/src/main/java/com/cflint/plugins/core/QueryNewChecker.java +++ b/src/main/java/com/cflint/plugins/core/QueryNewChecker.java @@ -22,8 +22,8 @@ public class QueryNewChecker extends CFLintScannerAdapter { /** * Check query new for unique columns listed in parm 1. - * @param expression expresison to check. - * @param context expresion context. + * @param expression expression to check. + * @param context expression context. * @param bugs list of bugs. */ @Override @@ -33,7 +33,7 @@ public void expression(final CFExpression expression, final Context context, fin if (functionExpression.getName().equalsIgnoreCase("querynew") && functionExpression.getArgs().size() > 0) { final CFExpression arg = functionExpression.getArgs().get(0); final String query = arg.Decompile(0); - //Build the list, then get unique with a set, pull them out of the list, anything + //Build the list, then get unique with a set, pull them out of the list, anything // left is a duplicate. final List cols = new ArrayList(Arrays.asList(query.toLowerCase().split("\\s*,\\s*"))); final Set cols_unique = new HashSet(cols); diff --git a/src/main/java/com/cflint/plugins/core/TooManyFunctionsChecker.java b/src/main/java/com/cflint/plugins/core/TooManyFunctionsChecker.java index 59322c2a5..57e28a03c 100644 --- a/src/main/java/com/cflint/plugins/core/TooManyFunctionsChecker.java +++ b/src/main/java/com/cflint/plugins/core/TooManyFunctionsChecker.java @@ -18,7 +18,7 @@ public class TooManyFunctionsChecker extends CFLintScannerAdapter { @Override public void expression(final CFScriptStatement expression, final Context context, final BugList bugs) { - if (expression instanceof CFFuncDeclStatement && !trivalFunction(context.getFunctionName())) { + if (expression instanceof CFFuncDeclStatement && !trivialFunction(context.getFunctionName())) { functionCount++; checkNumberFunctions(functionCount, 1, 0, context, bugs,context.getFunctionInfo().getName()); } @@ -26,13 +26,13 @@ public void expression(final CFScriptStatement expression, final Context context @Override public void element(final Element element, final Context context, final BugList bugs) { - if (element.getName().equals(CF.CFFUNCTION) && !trivalFunction(context.getFunctionName())) { + if (element.getName().equals(CF.CFFUNCTION) && !trivialFunction(context.getFunctionName())) { functionCount++; checkNumberFunctions(functionCount, 1, 0, context, bugs, null); } } - protected boolean trivalFunction(final String name) { + protected boolean trivialFunction(final String name) { final int length = name==null?0:name.length(); return length >= 3 && "get".equalsIgnoreCase(name.substring(1, 3)) || length >= 3 && "set".equalsIgnoreCase(name.substring(1, 3)) diff --git a/src/main/java/com/cflint/plugins/core/ValidName.java b/src/main/java/com/cflint/plugins/core/ValidName.java index 1b76cf476..86ec6e28a 100644 --- a/src/main/java/com/cflint/plugins/core/ValidName.java +++ b/src/main/java/com/cflint/plugins/core/ValidName.java @@ -149,7 +149,7 @@ public boolean isInvalidComponent(final String name,final String caseType) { * Valid characters in a name. * * @param name name of variable. - * @return true if the name consists of valid chartacters, false if it does not. + * @return true if the name consists of valid characters, false if it does not. */ public boolean validChars(final String name) { if(name == null) { @@ -163,7 +163,7 @@ public boolean validChars(final String name) { * Is a name all upper case?. * * @param name name of variable. - * @return true if the name is all upppercase, false if it is not. + * @return true if the name is all uppercase, false if it is not. */ public boolean isUpperCase(final String name) { if(name == null) { @@ -176,7 +176,7 @@ public boolean isUpperCase(final String name) { * Is a name all the same case. * * @param name name of variable. - * @return true if the name is all upppercase, false if it is not. + * @return true if the name is all uppercase, false if it is not. */ public boolean isSameCase(final String name) { if(name == null) { @@ -332,7 +332,7 @@ public boolean hasPrefixOrPostfix(final String name) { if (sentence.trim().length() == 0) { return false; } - + final String[] words = sentence.split(" "); final String firstWord = words[0]; final String lastWord = words[words.length - 1]; diff --git a/src/main/resources/cflint.definition.json b/src/main/resources/cflint.definition.json index 2277e16f0..26978612f 100644 --- a/src/main/resources/cflint.definition.json +++ b/src/main/resources/cflint.definition.json @@ -92,7 +92,7 @@ "message": [ { "code": "QUERYNEW_DATATYPE", - "messageText": "QueryNew statement should specify datatypes.", + "messageText": "QueryNew statement should specify data types.", "severity": "WARNING" } ], @@ -291,7 +291,7 @@ { "code": "ARG_HINT_MISSING_SCRIPT", "severity": "INFO", - "messageText": "Argument ${variable} is missing a hint. Use javadoc style annotations on cfscript functions." + "messageText": "Argument ${variable} is missing a hint. Use Javadoc style annotations on cfscript functions." } ], "parameter": [] @@ -326,7 +326,7 @@ "parameter": [ { "name": "length", - "value": "100" + "value": 100 } ] }, @@ -343,7 +343,7 @@ "parameter": [ { "name": "length", - "value": "500" + "value": 500 } ] }, @@ -377,7 +377,7 @@ "parameter": [ { "name": "maximum", - "value": "10" + "value": 10 } ] }, @@ -394,7 +394,7 @@ "parameter": [ { "name": "maximum", - "value": "10" + "value": 10 } ] }, @@ -411,7 +411,7 @@ "parameter": [ { "name": "maximum", - "value": "10" + "value": 10 } ] }, @@ -473,7 +473,7 @@ "parameter": [ { "name": "functionName", - "value": "IsDebugMode" + "value": "isDebugMode" } ] }, @@ -495,7 +495,7 @@ { "code": "AVOID_USING_ARRAYNEW", "severity": "INFO", - "messageText": "Use implict array construction instead (= [])." + "messageText": "Use implicit array construction instead (= [])." } ], "parameter": [] @@ -572,15 +572,15 @@ "parameter": [ { "name": "minLength", - "value": "3" + "value": 3 }, { "name": "maxLength", - "value": "20" + "value": 20 }, { "name": "maxWords", - "value": "4" + "value": 4 }, { "name": "ignoreUpperCaseScopes", @@ -648,15 +648,15 @@ "parameter": [ { "name": "minLength", - "value": "3" + "value": 3 }, { "name": "maxLength", - "value": "20" + "value": 20 }, { "name": "maxWords", - "value": "4" + "value": 4 }, { "name": "case", @@ -707,15 +707,15 @@ "parameter": [ { "name": "minLength", - "value": "3" + "value": 3 }, { "name": "maxLength", - "value": "25" + "value": 25 }, { "name": "maxWords", - "value": "5" + "value": 5 }, { "name": "case", @@ -766,15 +766,15 @@ "parameter": [ { "name": "minLength", - "value": "3" + "value": 3 }, { "name": "maxLength", - "value": "15" + "value": 15 }, { "name": "maxWords", - "value": "3" + "value": 3 }, { "name": "case", @@ -837,9 +837,6 @@ { "name": "usedTagAttributes", "value": [ - "cfquery/name", - "cfloop/index", - "cfloop/item", "cfchart/name", "cfdocument/name", "cfftp/name", @@ -848,8 +845,11 @@ "cfimage/name", "cfimap/name", "cfldap/name", + "cfloop/index", + "cfloop/item", "cfoutput/query", "cfpdf/name", + "cfquery/name", "cfreport/name", "cfsavecontent/name", "cfstoreproc/result", @@ -944,11 +944,11 @@ "parameter": [ { "name": "maximum", - "value": "3" + "value": 3 }, { "name": "maxWarnings", - "value": "5" + "value": 5 }, { "name": "warningScope", @@ -973,11 +973,11 @@ "parameter": [ { "name": "maximum", - "value": "3" + "value": 3 }, { "name": "maxWarnings", - "value": "5" + "value": 5 }, { "name": "warningScope", diff --git a/src/main/resources/cflint.description.txt b/src/main/resources/cflint.description.txt index cbcdd7c7d..6b88e5bbd 100644 --- a/src/main/resources/cflint.description.txt +++ b/src/main/resources/cflint.description.txt @@ -65,7 +65,7 @@ COMPONENT_TOO_WORDY:Component name contain too many words. COMPONENT_IS_TEMPORARY:Component name looks temporary. COMPONENT_HAS_PREFIX_OR_POSTFIX:Component name has prefix or postfix. FILE_SHOULD_START_WITH_LOWERCASE:CFM File starts with upper case. -AVOID_USING_CREATEOBJECT:Avoid use of creatObject statements. +AVOID_USING_CREATEOBJECT:Avoid use of createObject statements. AVOID_USING_DEBUG_ATTR:Avoid use of debug attribute. UNUSED_LOCAL_VARIABLE:Unused local variable. UNUSED_METHOD_ARGUMENT:Unused method argument. diff --git a/src/main/resources/findbugs/cflint-to-findbugs.xsl b/src/main/resources/findbugs/cflint-to-findbugs.xsl index a3ce493dd..b0ae5948e 100644 --- a/src/main/resources/findbugs/cflint-to-findbugs.xsl +++ b/src/main/resources/findbugs/cflint-to-findbugs.xsl @@ -111,10 +111,10 @@ Nested <cfquery/> tags, the outer tag has an @query attribute, it should also specify the @group attribute. - QueryNew should specify the datatypes of the columns. + QueryNew should specify the data types of the columns. - Variable is varr'd with the same name as one of the arguments. This is confusing or incorrect. + Variable is var'd with the same name as one of the arguments. This is confusing or incorrect. Variable referenced both as an unscoped (local) and an argument. diff --git a/src/test/java/com/cflint/TestArgumentNames.java b/src/test/java/com/cflint/TestArgumentNames.java index d55a7b4be..f8d2bdae9 100644 --- a/src/test/java/com/cflint/TestArgumentNames.java +++ b/src/test/java/com/cflint/TestArgumentNames.java @@ -34,7 +34,7 @@ public void testValidNamesTag() throws CFLintScanException { } @Test - public void testUpercaseNameTag() throws CFLintScanException { + public void testUppercaseNameTag() throws CFLintScanException { final String tagSrc = "\r\n" + "\r\n" + " \r\n" + " \r\n" + "\r\n" + ""; @@ -99,7 +99,7 @@ public void nameTooWordyTag() throws CFLintScanException { } @Test - public void nameIsTemporyTag() throws CFLintScanException { + public void nameIsTemporaryTag() throws CFLintScanException { final String tagSrc = "\r\n" + "\r\n" + " \r\n" + " \r\n" + " \r\n" + " \r\n" @@ -158,7 +158,7 @@ public void testValidNamesScript() throws CFLintScanException { } @Test - public void testUpercaseNameScript() throws CFLintScanException { + public void testUppercaseNameScript() throws CFLintScanException { final String scriptSrc = "component {\r\n" + "function test(FIRSTNAME, LAST_NAME) {\r\n" + "}\r\n" + "}"; CFLintResult lintresult = cfBugs.scan(scriptSrc, "test"); final List result = lintresult.getIssues().values().iterator().next(); @@ -216,7 +216,7 @@ public void nameTooWordyScript() throws CFLintScanException { } @Test - public void nameIsTemporyScript() throws CFLintScanException { + public void nameIsTemporaryScript() throws CFLintScanException { final String scriptSrc = "component {\r\n" + "function test(temp, obj, struct, tempName, nameObj, nameString) {\r\n" + "}\r\n" + "}"; CFLintResult lintresult = cfBugs.scan(scriptSrc, "test"); diff --git a/src/test/java/com/cflint/TestArrayNewChecker.java b/src/test/java/com/cflint/TestArrayNewChecker.java index ffe7aeafe..ca4b05bf8 100644 --- a/src/test/java/com/cflint/TestArrayNewChecker.java +++ b/src/test/java/com/cflint/TestArrayNewChecker.java @@ -1,59 +1,59 @@ -package com.cflint; - -import static org.junit.Assert.assertEquals; - -import java.util.List; - -import org.junit.Before; -import org.junit.Test; - -import com.cflint.api.CFLintAPI; -import com.cflint.api.CFLintResult; -import com.cflint.config.ConfigBuilder; -import com.cflint.exception.CFLintScanException; - -public class TestArrayNewChecker { - - private CFLintAPI cfBugs; - - @Before - public void setUp() throws Exception { - final ConfigBuilder configBuilder = new ConfigBuilder().include("AVOID_USING_ARRAYNEW"); - cfBugs = new CFLintAPI(configBuilder.build()); - } - - @Test - public void testArrayNewInScript() throws CFLintScanException { - final String scriptSrc = "\r\n" + "var a = 23;\r\n" + "var b = arrayNew(1);\r\n" + ""; - - CFLintResult lintresult = cfBugs.scan(scriptSrc, "test"); - final List result = lintresult.getIssues().values().iterator().next(); - assertEquals(1, result.size()); - assertEquals("AVOID_USING_ARRAYNEW", result.get(0).getMessageCode()); - assertEquals(4, result.get(0).getLine()); - assertEquals(Levels.INFO, result.get(0).getSeverity()); - assertEquals("Use implict array construction instead (= []).", result.get(0).getMessage()); - } - - @Test - public void testArrayNewMultiDimentionInScript() throws CFLintScanException { - final String scriptSrc = "\r\n" + "var a = 23;\r\n" + "var b = arrayNew(3);\r\n" + ""; - - CFLintResult lintresult = cfBugs.scan(scriptSrc, "test"); - assertEquals(0, lintresult.getIssues().size()); - } - - @Test - public void testArrayNewInTag() throws CFLintScanException { - final String tagSrc = "\r\n" + ""; - - CFLintResult lintresult = cfBugs.scan(tagSrc, "test"); - final List result = lintresult.getIssues().values().iterator().next(); - assertEquals(1, result.size()); - assertEquals("AVOID_USING_ARRAYNEW", result.get(0).getMessageCode()); - assertEquals(2, result.get(0).getLine()); - assertEquals(Levels.INFO, result.get(0).getSeverity()); - assertEquals("Use implict array construction instead (= []).", result.get(0).getMessage()); - } - -} +package com.cflint; + +import static org.junit.Assert.assertEquals; + +import java.util.List; + +import org.junit.Before; +import org.junit.Test; + +import com.cflint.api.CFLintAPI; +import com.cflint.api.CFLintResult; +import com.cflint.config.ConfigBuilder; +import com.cflint.exception.CFLintScanException; + +public class TestArrayNewChecker { + + private CFLintAPI cfBugs; + + @Before + public void setUp() throws Exception { + final ConfigBuilder configBuilder = new ConfigBuilder().include("AVOID_USING_ARRAYNEW"); + cfBugs = new CFLintAPI(configBuilder.build()); + } + + @Test + public void testArrayNewInScript() throws CFLintScanException { + final String scriptSrc = "\r\n" + "var a = 23;\r\n" + "var b = arrayNew(1);\r\n" + ""; + + CFLintResult lintresult = cfBugs.scan(scriptSrc, "test"); + final List result = lintresult.getIssues().values().iterator().next(); + assertEquals(1, result.size()); + assertEquals("AVOID_USING_ARRAYNEW", result.get(0).getMessageCode()); + assertEquals(4, result.get(0).getLine()); + assertEquals(Levels.INFO, result.get(0).getSeverity()); + assertEquals("Use implicit array construction instead (= []).", result.get(0).getMessage()); + } + + @Test + public void testArrayNewMultiDimensionInScript() throws CFLintScanException { + final String scriptSrc = "\r\n" + "var a = 23;\r\n" + "var b = arrayNew(3);\r\n" + ""; + + CFLintResult lintresult = cfBugs.scan(scriptSrc, "test"); + assertEquals(0, lintresult.getIssues().size()); + } + + @Test + public void testArrayNewInTag() throws CFLintScanException { + final String tagSrc = "\r\n" + ""; + + CFLintResult lintresult = cfBugs.scan(tagSrc, "test"); + final List result = lintresult.getIssues().values().iterator().next(); + assertEquals(1, result.size()); + assertEquals("AVOID_USING_ARRAYNEW", result.get(0).getMessageCode()); + assertEquals(2, result.get(0).getLine()); + assertEquals(Levels.INFO, result.get(0).getSeverity()); + assertEquals("Use implicit array construction instead (= []).", result.get(0).getMessage()); + } + +} diff --git a/src/test/java/com/cflint/TestCFBugs_ComponentNames.java b/src/test/java/com/cflint/TestCFBugs_ComponentNames.java index 230bdd0d8..b5f6ba132 100644 --- a/src/test/java/com/cflint/TestCFBugs_ComponentNames.java +++ b/src/test/java/com/cflint/TestCFBugs_ComponentNames.java @@ -32,7 +32,7 @@ public void testValidNamesTag() throws CFLintScanException { } @Test - public void testUpercaseNameTag() throws CFLintScanException { + public void testUppercaseNameTag() throws CFLintScanException { final String tagSrc = "\r\n" + ""; CFLintResult lintresult = cfBugs.scan(tagSrc, "UPPERCASE.cfc"); final List result = lintresult.getIssues().values().iterator().next(); @@ -102,7 +102,7 @@ public void nameTooWordyTag() throws CFLintScanException { } @Test - public void nameIsTemporyTag() throws CFLintScanException { + public void nameIsTemporaryTag() throws CFLintScanException { final String tagSrc = "\r\n" + ""; CFLintResult lintresult = cfBugs.scan(tagSrc, "Temp.cfc"); final List result = lintresult.getIssues().values().iterator().next(); @@ -140,7 +140,7 @@ public void testLowercaseNameScript() throws CFLintScanException { } @Test - public void testUpercaseNameScript() throws CFLintScanException { + public void testUppercaseNameScript() throws CFLintScanException { final String scriptSrc = "component {\r\n" + "}"; CFLintResult lintresult = cfBugs.scan(scriptSrc, "UPPERCASE.cfc"); final List result = lintresult.getIssues().values().iterator().next(); @@ -200,7 +200,7 @@ public void nameTooWordyScript() throws CFLintScanException { } @Test - public void nameIsTemporyScript() throws CFLintScanException { + public void nameIsTemporaryScript() throws CFLintScanException { final String scriptSrc = "component {\r\n" + "}"; CFLintResult lintresult = cfBugs.scan(scriptSrc, "Temp.cfc"); final List result = lintresult.getIssues().values().iterator().next(); diff --git a/src/test/java/com/cflint/TestCFBugs_MethodNames.java b/src/test/java/com/cflint/TestCFBugs_MethodNames.java index 4ccc64172..b2033b09b 100644 --- a/src/test/java/com/cflint/TestCFBugs_MethodNames.java +++ b/src/test/java/com/cflint/TestCFBugs_MethodNames.java @@ -34,7 +34,7 @@ public void testValidNamesTag() throws CFLintScanException { } @Test - public void testUpercaseNameTag() throws CFLintScanException { + public void testUppercaseNameTag() throws CFLintScanException { final String tagSrc = "\r\n" + "\r\n" + "\r\n" + ""; CFLintResult lintresult = cfBugs.scan(tagSrc, "test"); @@ -90,7 +90,7 @@ public void nameTooWordyTag() throws CFLintScanException { } @Test - public void nameIsTemporyTag() throws CFLintScanException { + public void nameIsTemporaryTag() throws CFLintScanException { final String tagSrc = "\r\n" + "\r\n" + "\r\n" + ""; CFLintResult lintresult = cfBugs.scan(tagSrc, "test"); @@ -120,7 +120,7 @@ public void testValidNamesScript() throws CFLintScanException { } @Test - public void testUpercaseNameScript() throws CFLintScanException { + public void testUppercaseNameScript() throws CFLintScanException { final String scriptSrc = "component {\r\n" + "function UPPERCASE() {\r\n" + "}\r\n" + "}"; CFLintResult lintresult = cfBugs.scan(scriptSrc, "test"); final List result = lintresult.getIssues().values().iterator().next(); @@ -170,7 +170,7 @@ public void nameTooWordyScript() throws CFLintScanException { } @Test - public void nameIsTemporyScript() throws CFLintScanException { + public void nameIsTemporaryScript() throws CFLintScanException { final String scriptSrc = "component {\r\n" + "function temp() {\r\n" + "}\r\n" + "}"; CFLintResult lintresult = cfBugs.scan(scriptSrc, "test"); final List result = lintresult.getIssues().get("METHOD_IS_TEMPORARY"); diff --git a/src/test/java/com/cflint/TestCFBugs_VariableNames.java b/src/test/java/com/cflint/TestCFBugs_VariableNames.java index 50a0e773d..bbaf79105 100644 --- a/src/test/java/com/cflint/TestCFBugs_VariableNames.java +++ b/src/test/java/com/cflint/TestCFBugs_VariableNames.java @@ -38,7 +38,7 @@ public void testValidNamesTag() throws CFLintScanException { } @Test - public void testUpercaseNameTag() throws CFLintScanException { + public void testUppercaseNameTag() throws CFLintScanException { final String tagSrc = "\r\n" + "\r\n" + " \r\n" + " \r\n" + " \r\n" + " \r\n" @@ -51,7 +51,7 @@ public void testUpercaseNameTag() throws CFLintScanException { } @Test - public void testUpercaseScopeTag() throws CFLintScanException { + public void testUppercaseScopeTag() throws CFLintScanException { final String tagSrc = "\r\n" + "\r\n" + " \r\n" + " \r\n" + " \r\n" + "\r\n" + ""; @@ -122,7 +122,7 @@ public void nameTooWordyTag() throws CFLintScanException { } @Test - public void nameIsTemporyTag() throws CFLintScanException { + public void nameIsTemporaryTag() throws CFLintScanException { final String tagSrc = "\r\n" + "\r\n" + " \r\n" + " \r\n" + " \r\n" + " \r\n" @@ -196,7 +196,7 @@ public void testValidNamesScript() throws CFLintScanException { } @Test - public void testUpercaseNameScript() throws CFLintScanException { + public void testUppercaseNameScript() throws CFLintScanException { final String scriptSrc = "component {\r\n" + "function test() {\r\n" + " var FIRSTNAME = \"Fred\";\r\n" + " LAST_NAME = \"Smith\";\r\n" + " names = {};\r\n" + " name.FIRST = \"Fred\";\r\n" + " NAMES[1] = \"Fred\";\r\n" + " local.NAME = \"Fred\";\r\n" + "}\r\n" + "}"; @@ -208,7 +208,7 @@ public void testUpercaseNameScript() throws CFLintScanException { } @Test - public void testUpercaseScopeScript() throws CFLintScanException { + public void testUppercaseScopeScript() throws CFLintScanException { final String scriptSrc = "component {\r\n" + "function test() {\r\n" + " this.name = \"Fred\";\r\n" + " LOCAL.name = \"Fred\";\r\n" + "}\r\n" + "}"; CFLintResult lintresult = cfBugs.scan(scriptSrc, "test"); @@ -273,7 +273,7 @@ public void nameTooWordyScript() throws CFLintScanException { } @Test - public void nameIsTemporyScript() throws CFLintScanException { + public void nameIsTemporaryScript() throws CFLintScanException { final String scriptSrc = "component {\r\n" + "function test() {\r\n" + " temp = \"Fred\";\r\n" + " name.temp = \"Fred\";\r\n" + " obj = \"Fred\";\r\n" + " struct = \"Fred\";\r\n" + " tempName = \"Fred\";\r\n" + " nameObj = \"Fred\";\r\n" + " nameString = \"Fred\";\r\n" @@ -296,7 +296,7 @@ public void nameIsTemporyScript() throws CFLintScanException { } @Test - public void nameIsTemporyNestedScript() throws CFLintScanException { + public void nameIsTemporaryNestedScript() throws CFLintScanException { final String scriptSrc = "component {\r\n" + "function foo() {\r\n" + " var tempStruct = {};\r\n" + " doSomething(tempStruct);\r\n" + " tempStruct.foo = \"bar\";\r\n" + " }\r\n" + "}\r\n"; CFLintResult lintresult = cfBugs.scan(scriptSrc, "test"); diff --git a/src/test/java/com/cflint/TestCFCustomTagChecker.java b/src/test/java/com/cflint/TestCFCustomTagChecker.java index 40277f979..aba764756 100644 --- a/src/test/java/com/cflint/TestCFCustomTagChecker.java +++ b/src/test/java/com/cflint/TestCFCustomTagChecker.java @@ -20,7 +20,7 @@ public class TestCFCustomTagChecker { @Before public void setUp() throws Exception { - + final CFLintConfig conf = new CFLintConfig(); final PluginInfoRule pluginRuleX = new PluginInfoRule(); pluginRuleX.setName("CFXTagChecker"); @@ -28,10 +28,10 @@ public void setUp() throws Exception { final PluginMessage pluginMessageX = new PluginMessage("AVOID_USING_MYLIB:CFCUSTOMTAG_TAG"); pluginMessageX.setSeverity(Levels.WARNING); pluginMessageX.setMessageText( - "Avoid Leaving <${tagName}> tags in committed code. Debug information should be ommited from release code"); + "Avoid Leaving <${tagName}> tags in committed code. Debug information should be omitted from release code"); pluginRuleX.getMessages().add(pluginMessageX); pluginRuleX.addParameter("tagName", ".*:cfcustomtag"); - + CFLintPluginInfo pluginInfo = new CFLintPluginInfo(); pluginInfo.getRules().add(pluginRuleX); pluginRuleX.setClassName("CFXTagChecker"); diff --git a/src/test/java/com/cflint/TestComplexBooleanExpressionChecker.java b/src/test/java/com/cflint/TestComplexBooleanExpressionChecker.java index d28b3caeb..b3726af23 100644 --- a/src/test/java/com/cflint/TestComplexBooleanExpressionChecker.java +++ b/src/test/java/com/cflint/TestComplexBooleanExpressionChecker.java @@ -74,7 +74,7 @@ public void testSetBooleanExpressionInScript() throws CFLintScanException { } @Test - public void testReurnBooleanExpressionInTag() throws CFLintScanException { + public void testReturnBooleanExpressionInTag() throws CFLintScanException { final String tagSrc = "\r\n" + "\r\n" + ""; diff --git a/src/test/java/com/cflint/TestCreateObjectChecker.java b/src/test/java/com/cflint/TestCreateObjectChecker.java index e038e5827..78ddc6f70 100644 --- a/src/test/java/com/cflint/TestCreateObjectChecker.java +++ b/src/test/java/com/cflint/TestCreateObjectChecker.java @@ -48,7 +48,7 @@ public void testCreateObjectComponentMultiLine() throws CFLintScanException { } @Test - public void testCreatObjectJava() throws CFLintScanException { + public void testCreateObjectJava() throws CFLintScanException { final String scriptSrc = "\r\n" + "var a = 23;\r\n" + "var obj = createObject(\"java\",\"javaPath\");\r\n" + ""; diff --git a/src/test/java/com/cflint/TestFileCaseChecker.java b/src/test/java/com/cflint/TestFileCaseChecker.java index b8496d2f2..e61d163ea 100644 --- a/src/test/java/com/cflint/TestFileCaseChecker.java +++ b/src/test/java/com/cflint/TestFileCaseChecker.java @@ -40,7 +40,7 @@ public void testLowerCaseCFCName() throws CFLintScanException { } @Test - public void testUppeCaseCFMName() throws CFLintScanException { + public void testUpperCaseCFMName() throws CFLintScanException { final String cfmSrc = ""; CFLintResult lintresult = cfBugs.scan(cfmSrc, "Test.cfm"); final List result = lintresult.getIssues().values().iterator().next(); @@ -50,7 +50,7 @@ public void testUppeCaseCFMName() throws CFLintScanException { } @Test - public void testUppperCaseCFCName() throws CFLintScanException { + public void testUpperCaseCFCName() throws CFLintScanException { final String cfcSrc = ""; CFLintResult lintresult = cfBugs.scan(cfcSrc, "Test.cfc"); Collection> result = lintresult.getIssues().values(); diff --git a/src/test/java/com/cflint/TestJSONOutput.java b/src/test/java/com/cflint/TestJSONOutput.java index fa6da3503..e698c6e39 100644 --- a/src/test/java/com/cflint/TestJSONOutput.java +++ b/src/test/java/com/cflint/TestJSONOutput.java @@ -12,14 +12,14 @@ public class TestJSONOutput { - private JSONOutput outputer; + private JSONOutput outputter; private BugList bugList; private Writer writer; @Before public void setUp() { - outputer = new JSONOutput(); - outputer.setPrettyPrint(false); + outputter = new JSONOutput(); + outputter.setPrettyPrint(false); bugList = new BugList(null); writer = new StringWriter(); } @@ -30,7 +30,7 @@ public void testOutput() throws IOException { .setFilename("c:\\temp\\test.cfc").build(); bugList.add(bugInfo); CFLintStats stats = new CFLintStats(123456L, 1, new BigInteger("545454")); - outputer.output(bugList, writer, stats); + outputter.output(bugList, writer, stats); String expectedText = "{\"version\":\"\",\"timestamp\":123456,\"issues\":[{\"severity\":\"\",\"id\":\"PARSE_ERROR\",\"message\":\"PARSE_ERROR\",\"category\":\"CFLINT\",\"abbrev\":\"PE\",\"locations\":[{\"file\":\"c:\\\\temp\\\\test.cfc\",\"fileName\":\"test.cfc\",\"function\":\"testf\",\"offset\":0,\"column\":1,\"line\":1,\"message\":\"\",\"variable\":\"\",\"expression\":\"\"}]}],\"counts\":{\"totalFiles\":1,\"totalLines\":545454,\"countByCode\":[],\"countBySeverity\":[]}}"; assertEquals(expectedText, writer.toString()); @@ -44,7 +44,7 @@ public void testStats() throws IOException { BugCounts counts = new BugCounts(); counts.add("PARSE_ERROR", null); CFLintStats stats = new CFLintStats(123456L, 1, new BigInteger("545454"), counts); - outputer.output(bugList, writer, stats); + outputter.output(bugList, writer, stats); String expectedText = "{\"version\":\"\",\"timestamp\":123456,\"issues\":[{\"severity\":\"\",\"id\":\"PARSE_ERROR\",\"message\":\"PARSE_ERROR\",\"category\":\"CFLINT\",\"abbrev\":\"PE\",\"locations\":[{\"file\":\"c:\\\\temp\\\\test.cfc\",\"fileName\":\"test.cfc\",\"function\":\"testf\",\"offset\":0,\"column\":1,\"line\":1,\"message\":\"\",\"variable\":\"\",\"expression\":\"\"}]}],\"counts\":{\"totalFiles\":1,\"totalLines\":545454,\"countByCode\":[{\"code\":\"PARSE_ERROR\",\"count\":1}],\"countBySeverity\":[]}}"; assertEquals(expectedText, writer.toString()); @@ -58,7 +58,7 @@ public void testStatsWithSeverity() throws IOException { BugCounts counts = new BugCounts(); counts.add("PARSE_ERROR", Levels.ERROR); CFLintStats stats = new CFLintStats(123456L, 1, new BigInteger("545454"), counts); - outputer.output(bugList, writer, stats); + outputter.output(bugList, writer, stats); String expectedText = "{\"version\":\"\",\"timestamp\":123456,\"issues\":[{\"severity\":\"ERROR\",\"id\":\"PARSE_ERROR\",\"message\":\"PARSE_ERROR\",\"category\":\"CFLINT\",\"abbrev\":\"PE\",\"locations\":[{\"file\":\"c:\\\\temp\\\\test.cfc\",\"fileName\":\"test.cfc\",\"function\":\"testf\",\"offset\":0,\"column\":1,\"line\":1,\"message\":\"\",\"variable\":\"\",\"expression\":\"\"}]}],\"counts\":{\"totalFiles\":1,\"totalLines\":545454,\"countByCode\":[{\"code\":\"PARSE_ERROR\",\"count\":1}],\"countBySeverity\":[{\"severity\":\"ERROR\",\"count\":1}]}}"; assertEquals(expectedText, writer.toString()); diff --git a/src/test/java/com/cflint/TestUnusedArgumentChecker.java b/src/test/java/com/cflint/TestUnusedArgumentChecker.java index f9262bf94..6fcb79a53 100644 --- a/src/test/java/com/cflint/TestUnusedArgumentChecker.java +++ b/src/test/java/com/cflint/TestUnusedArgumentChecker.java @@ -195,7 +195,7 @@ public void testArgumentsUsedInTagWithArgumentsScope() throws CFLintScanExceptio } @Test - public void testArgumentsUsedInQuerygWithArgumentsScope() throws CFLintScanException { + public void testArgumentsUsedInQueryWithArgumentsScope() throws CFLintScanException { final String tagSrc = "\r\n" + "\r\n" + "\r\n" + "\r\n" + "\r\n" + "\r\n" diff --git a/src/test/java/com/cflint/TestUnusedLocalVarChecker.java b/src/test/java/com/cflint/TestUnusedLocalVarChecker.java index 27146c8b5..33ffdab32 100644 --- a/src/test/java/com/cflint/TestUnusedLocalVarChecker.java +++ b/src/test/java/com/cflint/TestUnusedLocalVarChecker.java @@ -178,7 +178,7 @@ public void testMultipleUnusedVarFunctionInTag() throws CFLintScanException { } @Test - public void testUsedVarInQuaryParam() throws CFLintScanException { + public void testUsedVarInQueryParam() throws CFLintScanException { final String tagSrc = "\r\n" + "\r\n" + "\r\n" + "var salt = createUUID();\r\n" + "var hash = hash(password & salt);\r\n" + "var update = \"\";\r\n" + "\r\n" + "\r\n" + "update logins\r\n" diff --git a/src/test/java/com/cflint/TestValidNames.java b/src/test/java/com/cflint/TestValidNames.java index e4d790fe6..5d41618fb 100644 --- a/src/test/java/com/cflint/TestValidNames.java +++ b/src/test/java/com/cflint/TestValidNames.java @@ -26,7 +26,7 @@ public void testInvalid() { assertFalse(name.isInvalid("UPPERCASE","CamelCase")); assertFalse(name.isInvalid("99_bottles_of_beer","CamelCase")); - assertTrue(name.isInvalid("UppperCaseCamel","CamelCase")); + assertTrue(name.isInvalid("UpperCaseCamel","CamelCase")); assertFalse(name.isInvalid("endsInNumber99","CamelCase")); } diff --git a/src/test/java/com/cflint/TestXMLOutput.java b/src/test/java/com/cflint/TestXMLOutput.java index 4ee597f84..73c9219fb 100644 --- a/src/test/java/com/cflint/TestXMLOutput.java +++ b/src/test/java/com/cflint/TestXMLOutput.java @@ -12,13 +12,13 @@ public class TestXMLOutput { - private XMLOutput outputer; + private XMLOutput outputter; private BugList bugList; private Writer writer; @Before public void setUp() { - outputer = new XMLOutput(); + outputter = new XMLOutput(); bugList = new BugList(null); writer = new StringWriter(); } @@ -29,7 +29,7 @@ public void testOutput() throws IOException { .setFilename("c:\\temp\\test.cfc").build(); bugList.add(bugInfo); CFLintStats stats = new CFLintStats(123456L, 1, new BigInteger("545454")); - outputer.output(bugList, writer, stats); + outputter.output(bugList, writer, stats); String expectedText = "\n" + "\n" + "\n" + "\n" + "" + ""; @@ -46,7 +46,7 @@ public void testStats() throws IOException { BugCounts counts = new BugCounts(); counts.add("PARSE_ERROR", null); CFLintStats stats = new CFLintStats(123456L, 1, new BigInteger("545454"), counts); - outputer.output(bugList, writer, stats); + outputter.output(bugList, writer, stats); String expectedText = "\n" + "\n" @@ -64,7 +64,7 @@ public void testStatsAndSeverity() throws IOException { BugCounts counts = new BugCounts(); counts.add("PARSE_ERROR", Levels.ERROR); CFLintStats stats = new CFLintStats(123456L, 1, new BigInteger("545454"), counts); - outputer.output(bugList, writer, stats); + outputter.output(bugList, writer, stats); String expectedText = "\n" + "\n"