├── .editorconfig ├── .externalToolBuilders └── .gitignore ├── .github └── workflows │ └── gradle.yml ├── .gitignore ├── .travis.yml ├── BUILDING.md ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── Dockerfile ├── LICENSE ├── README.md ├── RULES.md ├── build-instructions.md ├── build.gradle ├── cobertura.gradle ├── deploy.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── logo ├── logo.ai ├── logo.eps ├── logo.png └── logo.svg ├── pom.xml ├── pom.xml.versionsBackup ├── settings.gradle └── src ├── main ├── ant │ └── build.xml ├── assembly │ └── archive.xml ├── config │ ├── cflintexclude.json │ └── log4j.xml ├── java │ └── com │ │ └── cflint │ │ ├── BugCounts.java │ │ ├── BugInfo.java │ │ ├── BugList.java │ │ ├── Bugs.java │ │ ├── CF.java │ │ ├── CFLint.java │ │ ├── CFLintStats.java │ │ ├── HTMLOutput.java │ │ ├── JSONOutput.java │ │ ├── Levels.java │ │ ├── StackHandler.java │ │ ├── StructuredOutput.java │ │ ├── TextOutput.java │ │ ├── Version.java │ │ ├── XMLOutput.java │ │ ├── ant │ │ └── CFLintTask.java │ │ ├── api │ │ ├── CFLintAPI.java │ │ └── CFLintResult.java │ │ ├── cli │ │ ├── CFLintCLI.java │ │ └── Settings.java │ │ ├── config │ │ ├── BaseConfig.java │ │ ├── CFLintChainedConfig.java │ │ ├── CFLintConfig.java │ │ ├── CFLintConfiguration.java │ │ ├── CFLintPluginInfo.java │ │ ├── ConfigBuilder.java │ │ ├── ConfigFileLoader.java │ │ └── ConfigUtils.java │ │ ├── exception │ │ ├── CFLintConfigurationException.java │ │ └── CFLintScanException.java │ │ ├── listeners │ │ ├── ProgressMonitorListener.java │ │ └── ScanProgressListener.java │ │ ├── main │ │ └── CFLintMain.java │ │ ├── plugins │ │ ├── CFLintScanner.java │ │ ├── CFLintScannerAdapter.java │ │ ├── CFLintSet.java │ │ ├── CFLintStructureListener.java │ │ ├── Context.java │ │ ├── core │ │ │ ├── AbortChecker.java │ │ │ ├── ArgDefChecker.java │ │ │ ├── ArgDefConditionChecker.java │ │ │ ├── ArgHintChecker.java │ │ │ ├── ArgTypeChecker.java │ │ │ ├── ArgVarChecker.java │ │ │ ├── ArgumentNameChecker.java │ │ │ ├── ArrayNewChecker.java │ │ │ ├── BooleanExpressionChecker.java │ │ │ ├── BuiltInFunctionChecker.java │ │ │ ├── CFCompareVsAssignChecker.java │ │ │ ├── CFDebugAttributeChecker.java │ │ │ ├── CFQueryChecker.java │ │ │ ├── CFScopes.java │ │ │ ├── CFSwitchDefaultChecker.java │ │ │ ├── CFTagCaseChecker.java │ │ │ ├── CFXTagChecker.java │ │ │ ├── ComplexBooleanExpressionChecker.java │ │ │ ├── ComponentDisplayNameChecker.java │ │ │ ├── ComponentHintChecker.java │ │ │ ├── ComponentLengthChecker.java │ │ │ ├── ComponentNameChecker.java │ │ │ ├── ConfigError.java │ │ │ ├── CreateObjectChecker.java │ │ │ ├── FileCaseChecker.java │ │ │ ├── FunctionCollisionChecker.java │ │ │ ├── FunctionHintChecker.java │ │ │ ├── FunctionLengthChecker.java │ │ │ ├── FunctionTypeChecker.java │ │ │ ├── FunctionXChecker.java │ │ │ ├── GlobalVarChecker.java │ │ │ ├── HintChecker.java │ │ │ ├── LengthChecker.java │ │ │ ├── LiteralChecker.java │ │ │ ├── MethodNameChecker.java │ │ │ ├── NestedCFOutput.java │ │ │ ├── OutputParmMissing.java │ │ │ ├── PackageCaseChecker.java │ │ │ ├── QueryNewChecker.java │ │ │ ├── QueryParamChecker.java │ │ │ ├── ScriptTagChecker.java │ │ │ ├── SelectStarChecker.java │ │ │ ├── SimpleComplexityChecker.java │ │ │ ├── StructKeyChecker.java │ │ │ ├── TooManyArgumentsChecker.java │ │ │ ├── TooManyFunctionsChecker.java │ │ │ ├── TypedQueryNew.java │ │ │ ├── UnusedArgumentChecker.java │ │ │ ├── UnusedLocalVarChecker.java │ │ │ ├── ValidName.java │ │ │ ├── VarScoper.java │ │ │ └── VariableNameChecker.java │ │ └── exceptions │ │ │ ├── CFLintExceptionListener.java │ │ │ └── DefaultCFLintExceptionListener.java │ │ ├── tools │ │ ├── AllowedExtensionsLoader.java │ │ ├── CFLintDoc.java │ │ ├── CFLintFilter.java │ │ ├── CFMLTagInfo.java │ │ ├── CFTool.java │ │ ├── CommentReformatting.java │ │ ├── FileUtil.java │ │ ├── ObjectEquals.java │ │ ├── PrecedingCommentReader.java │ │ └── ScanningProgressMonitorLookAhead.java │ │ └── xml │ │ ├── CFLintResultMarshaller.java │ │ ├── MarshallerException.java │ │ └── stax │ │ ├── DefaultCFlintResultMarshaller.java │ │ └── FindBugsCFLintResultMarshaller.java └── resources │ ├── CFLint-logo.jpg │ ├── cfdocs │ └── functions.json │ ├── cflint.definition.json │ ├── cflint.description.txt │ ├── changelog.mustache │ ├── com │ └── cflint │ │ └── cflint.properties │ ├── findbugs │ ├── bugcollection.xsd │ ├── cflint-to-findbugs.xsl │ ├── default.xsl │ └── plain.xsl │ ├── logos │ ├── CFLint-logo.png │ ├── largelogo.png │ └── logo24x24.png │ ├── schemas │ ├── .cflintrc.schema.json │ ├── cflint-result.schema.json │ └── cflint-result.xsd │ └── scripts │ ├── getLatestTag.sh │ └── writeChangelog.sh └── test ├── java └── com │ └── cflint │ ├── TestAbortChecker.java │ ├── TestArgumentNames.java │ ├── TestArrayNewChecker.java │ ├── TestBooleanExpressionChecker.java │ ├── TestCFAbortChecker.java │ ├── TestCFBugs.java │ ├── TestCFBugsFilter.java │ ├── TestCFBugsTagless.java │ ├── TestCFBugs_ArgsDef.java │ ├── TestCFBugs_ArgsDefCond.java │ ├── TestCFBugs_ArgsHint.java │ ├── TestCFBugs_ArgsType.java │ ├── TestCFBugs_ArgsUse.java │ ├── TestCFBugs_Comments.java │ ├── TestCFBugs_ComponentHint.java │ ├── TestCFBugs_ComponentName.java │ ├── TestCFBugs_ComponentNames.java │ ├── TestCFBugs_FunctionHint.java │ ├── TestCFBugs_FunctionType.java │ ├── TestCFBugs_GLobalVarChecker.java │ ├── TestCFBugs_MethodNames.java │ ├── TestCFBugs_OutputDef.java │ ├── TestCFBugs_ParseError.java │ ├── TestCFBugs_QueryParams.java │ ├── TestCFBugs_SimpleComplexity.java │ ├── TestCFBugs_TooManyArguments.java │ ├── TestCFBugs_VarScoper.java │ ├── TestCFBugs_VarScoper_Names.java │ ├── TestCFBugs_VarScoper_TagAttr.java │ ├── TestCFBugs_VariableNames.java │ ├── TestCFCustomTagChecker.java │ ├── TestCFDebugAttributeTagChecker.java │ ├── TestCFDumpChecker.java │ ├── TestCFExecuteChecker.java │ ├── TestCFInsertTagChecker.java │ ├── TestCFLint2Files.java │ ├── TestCFModuleTagChecker.java │ ├── TestCFTagLowercaseChecker.java │ ├── TestCFTagUppercaseChecker.java │ ├── TestCFUpdateTagChecker.java │ ├── TestComplexBooleanExpressionChecker.java │ ├── TestComponentLengthChecker.java │ ├── TestCreateObjectChecker.java │ ├── TestDebugChecker.java │ ├── TestFileCaseChecker.java │ ├── TestFunctionLengthChecker.java │ ├── TestJSONOutput.java │ ├── TestLiteralGlobalChecker.java │ ├── TestLiteralLocalChecker.java │ ├── TestParsingErrors.java │ ├── TestStructNewChecker.java │ ├── TestUnusedArgumentChecker.java │ ├── TestUnusedLocalVarChecker.java │ ├── TestValidNames.java │ ├── TestWriteDumpChecker.java │ ├── TestXMLOutput.java │ ├── Test_Switch_Default_Checker.java │ ├── config │ ├── TestCFLintChainedConfig.java │ ├── TestCFLintConfig.java │ ├── TestCFLintConfig2.java │ └── TestConfigUtils.java │ ├── integration │ ├── TestCLintConfigXml.java │ ├── TestFiles.java │ └── TestIntegrationFolder.java │ └── tools │ ├── TestCFLintDoc.java │ ├── TestCFMLTagInfo.java │ └── TestCommentReformatting.java └── resources ├── com └── cflint │ ├── integration │ ├── .cflintrc │ ├── .gitignore │ ├── inherit │ │ ├── .cflintrc │ │ └── test.cfc │ ├── output.expected.json │ ├── output.rulegroup.expected.json │ ├── output_194.expected.json │ ├── standalone │ │ ├── .cflintrc │ │ └── test.cfc │ └── test.cfc │ ├── test.properties │ └── tests │ ├── ArgVarChecker │ ├── .cflintrc │ ├── cfc_540.cfc │ ├── cfc_540.expected.txt │ ├── cfc_540_b.cfc │ ├── cfc_540_b.expected.txt │ ├── cfc_540_c.cfc │ ├── cfc_540_c.expected.txt │ ├── cfc_540_d.cfc │ ├── cfc_540_d.expected.txt │ ├── cfml_540.cfc │ ├── cfml_540.expected.txt │ ├── implicitStructKey_478.cfc │ ├── implicitStructKey_478.expected.txt │ ├── mixed_471.cfc │ └── mixed_471.expected.txt │ ├── ArgVarConflict │ ├── .cflintrc │ ├── mixedScopeExample.cfc │ └── mixedScopeExample.expected.txt │ ├── BuiltInFunctionChecker │ ├── .cflintrc │ ├── isDate1.cfm │ ├── isDate1.expected.txt │ ├── isDate2.cfm │ └── isDate2.expected.txt │ ├── CFDebugAttributeChecker │ ├── .cflintrc │ ├── cfquery1_487.cfc │ ├── cfquery1_487.expected.txt │ ├── cfquery2_488.cfc │ ├── cfquery2_488.expected.txt │ ├── cfquery3_489.cfc │ ├── cfquery3_489.expected.txt │ ├── cfquery4_490.cfc │ ├── cfquery4_490.expected.txt │ ├── cfquery5_490.cfc │ └── cfquery5_490.expected.txt │ ├── CFIncludeChecker │ ├── .cflintrc │ ├── cfinclude1.cfc │ ├── cfinclude1.expected.txt │ ├── lonelyCfinclude.cfc │ └── lonelyCfinclude.expected.txt │ ├── CompareInsteadOfAssign │ ├── .cflintrc │ ├── Compare1.cfm │ ├── Compare1.expected.txt │ ├── Compare2.cfm │ └── Compare2.expected.txt │ ├── Complexity │ ├── .cflintrc │ ├── ifelse.cfc │ ├── ifelse.expected.txt │ ├── ifelseComplex.cfc │ └── ifelseComplex.expected.txt │ ├── ComponentNameChecker │ ├── .cflintrc │ ├── foo.cfc │ ├── foo.expected.txt │ ├── foofoo.cfc │ ├── foofoo.expected.txt │ ├── veryLongComponentName.cfc │ └── veryLongComponentName.expected.txt │ ├── EmptyFile │ ├── .cflintrc │ ├── foo.cfc │ ├── foo.expected.txt │ ├── fooWS.cfc │ └── fooWS.expected.txt │ ├── ExcludesAll │ ├── .cflintrc │ ├── someErrors.cfc │ └── someErrors.expected.txt │ ├── FunctionCollision │ ├── .cflintrc │ ├── function_abs.cfc │ ├── function_abs.expected.txt │ ├── function_abs_cfml.cfc │ ├── function_abs_cfml.expected.txt │ ├── function_x.cfc │ └── function_x.expected.txt │ ├── FunctionType │ ├── Any │ │ ├── .cflintrc │ │ ├── functionany1.cfc │ │ ├── functionany1.expected.txt │ │ ├── functionmissing1.cfc │ │ └── functionmissing1.expected.txt │ └── Missing │ │ ├── .cflintrc │ │ ├── component_500.cfc │ │ └── component_500.expected.txt │ ├── GlobalVarChecker │ ├── .cflintrc │ ├── cfcatch_tag.cfc │ └── cfcatch_tag.expected.txt │ ├── Hints │ ├── .cflintrc │ ├── arg_hints_missing.cfc │ ├── arg_hints_missing.expected.txt │ ├── hints1.cfc │ ├── hints1.expected.txt │ ├── hints2_hintattribute.cfc │ ├── hints2_hintattribute.expected.txt │ ├── hints3_hintannotation.cfc │ ├── hints3_hintannotation.expected.txt │ ├── hints4_emptycomment.cfc │ ├── hints4_emptycomment.expected.txt │ ├── hints5_comment.cfc │ └── hints5_comment.expected.txt │ ├── Ignores │ ├── .cflintrc │ ├── args │ │ ├── .cflintrc │ │ ├── test_497.cfc │ │ └── test_497.expected.txt │ ├── ignoreCFMLAny1.cfc │ ├── ignoreCFMLAny1.expected.txt │ ├── ignoreCFMLAny2.cfc │ ├── ignoreCFMLAny2.expected.txt │ ├── ignoreCFMLAny3_Nested.cfc │ ├── ignoreCFMLAny3_Nested.expected.txt │ ├── ignoreCFMLAny4.cfc │ ├── ignoreCFMLAny4.expected.txt │ ├── ignoreCFMLAny5.cfc │ ├── ignoreCFMLAny5.expected.txt │ ├── ignoreCFMLComponent.cfc │ ├── ignoreCFMLComponent.expected.txt │ ├── ignoreCFMLComponent2.cfc │ ├── ignoreCFMLComponent2.expected.txt │ ├── ignoreCFMLFunction.cfc │ ├── ignoreCFMLFunction.expected.txt │ ├── ignoreLine1.cfc │ ├── ignoreLine1.expected.txt │ ├── ignoreLineMessage1.cfc │ ├── ignoreLineMessage1.expected.txt │ ├── ignoreLineMessageUnmatched.cfc │ ├── ignoreLineMessageUnmatched.expected.txt │ ├── ignoreMultiLine.cfc │ ├── ignoreMultiLine.expected.txt │ ├── ignoreMultiLine2.cfc │ ├── ignoreMultiLine2.expected.txt │ ├── ignoreMultiLineComponent.cfc │ ├── ignoreMultiLineComponent.expected.txt │ ├── ignoreMultiLineComponent2.cfc │ ├── ignoreMultiLineComponent2.expected.txt │ ├── ignore_467.cfc │ ├── ignore_467.expected.txt │ ├── ignore_489.cfc │ └── ignore_489.expected.txt │ ├── Includes │ ├── .cflintrc │ ├── Header.cfm │ ├── Header.expected.txt │ ├── Template.cfm │ └── Template.expected.txt │ ├── LiteralChecker │ ├── .cflintrc │ ├── literal_arraysort.cfc │ ├── literal_arraysort.expected.txt │ ├── literal_checker_326.cfm │ └── literal_checker_326.expected.txt │ ├── MethodNameChecker │ └── .cflintrc │ ├── MissingDeclaration │ ├── .cflintrc │ ├── array_used.cfc │ ├── array_used.expected.txt │ ├── collect_used.cfc │ └── collect_used.expected.txt │ ├── MissingSemiColon │ ├── .cflintrc │ ├── missingSemis1.cfc │ └── missingSemis1.expected.txt │ ├── Naming │ ├── .cflintrc │ ├── Inconsistent_544.cfc │ ├── Inconsistent_544.expected.txt │ ├── Inconsistent_545_cfml.cfm │ ├── Inconsistent_545_cfml.expected.txt │ ├── NewComponent_472.cfc │ ├── NewComponent_472.expected.txt │ ├── nameEndsInNumberScript.cfc │ ├── nameEndsInNumberScript.expected.txt │ ├── tempVar.cfc │ └── tempVar.expected.txt │ ├── PackageCase │ ├── .cflintrc │ ├── packagecase_nok.cfc │ ├── packagecase_nok.cfc.2 │ ├── packagecase_nok.expected.txt │ ├── packagecase_nokC.cfc │ ├── packagecase_nokC.cfc.2 │ ├── packagecase_nokC.expected.txt │ ├── packagecase_nok_b.cfc │ ├── packagecase_nok_b.expected.txt │ ├── packagecase_ok.cfc │ ├── packagecase_ok.cfc.2 │ └── packagecase_ok.expected.txt │ ├── ParseError │ ├── .cflintrc │ ├── attr_space_536.cfm │ ├── attr_space_536.expected.txt │ ├── case_623.cfm │ ├── case_623.expected.txt │ ├── cfloop_359.cfm │ ├── cfloop_359.expected.txt │ ├── fileoutput_359.cfm │ ├── fileoutput_359.expected.txt │ ├── keys_599.cfm │ ├── keys_599.expected.txt │ ├── nestedcomments_629.cfc │ ├── nestedcomments_629.expected.txt │ ├── npe_595.cfm │ ├── npe_595.expected.txt │ ├── ordered_Struct_534.cfm │ ├── ordered_Struct_534.expected.txt │ ├── outside_output_359.cfm │ ├── outside_output_359.expected.txt │ ├── queryparam_569.cfc │ ├── queryparam_569.expected.txt │ ├── singlequote_359.cfm │ └── singlequote_359.expected.txt │ ├── Parsing │ ├── .cflintrc │ ├── Underscore.cfc │ ├── Underscore.expected.txt │ ├── columns │ │ ├── .cflintrc │ │ ├── test.cfc │ │ └── test.expected.txt │ ├── customerror_647.cfc │ ├── customerror_647.expected.txt │ ├── encodeing_580.cfc │ ├── encodeing_580.expected.txt │ ├── import_359.cfc │ ├── import_359.expected.txt │ ├── include_506.cfm │ ├── include_506.expected.txt │ ├── include_96.cfc │ ├── include_96.expected.txt │ ├── inlinearray_650.cfc │ ├── inlinearray_650.expected.txt │ ├── interface.cfc │ ├── interface.expected.txt │ ├── npe_408.cfc │ ├── npe_408.expected.txt │ ├── parsing251.cfc │ ├── parsing251.expected.txt │ ├── parsing253.cfm │ ├── parsing253.expected.txt │ ├── parsing_346.cfc │ └── parsing_346.expected.txt │ ├── Query │ ├── .cflintrc │ ├── cfquery_param.cfc │ ├── cfquery_param.expected.txt │ ├── cfquery_param2.cfc │ ├── cfquery_param2.expected.txt │ ├── cfquery_param3.cfc │ ├── cfquery_param3.expected.txt │ ├── cfquery_param_571_a.cfc │ ├── cfquery_param_571_a.expected.txt │ ├── cfquery_param_571_b.cfc │ ├── cfquery_param_571_b.expected.txt │ ├── cfquery_param_571_c.cfc │ ├── cfquery_param_571_c.expected.txt │ ├── cfquery_param_571_d.cfc │ ├── cfquery_param_571_d.expected.txt │ ├── cfquery_param_byline.cfc │ ├── cfquery_param_byline.expected.txt │ ├── cfquery_param_byline_nest.cfc │ ├── cfquery_param_byline_nest.expected.txt │ ├── cfquery_param_case.cfc │ ├── cfquery_param_case.expected.txt │ ├── cfquery_script_param_571_a.cfc │ └── cfquery_script_param_571_a.expected.txt │ ├── QueryNewChecker │ ├── .cflintrc │ ├── querynew_549.cfc │ └── querynew_549.expected.txt │ ├── StructKeyChecker │ ├── .cflintrc │ ├── dotNotation_405.cfc │ ├── dotNotation_405.expected.txt │ ├── quotedStructKey2.cfc │ ├── quotedStructKey2.expected.txt │ ├── top_level_542.cfc │ ├── top_level_542.expected.txt │ ├── unquotedStructKey.cfc │ ├── unquotedStructKey.expected.txt │ ├── unquotedStructKeyNested.cfc │ └── unquotedStructKeyNested.expected.txt │ ├── TooManyFunctionsChecker │ ├── .cflintrc │ ├── excessive_cfml.cfc │ ├── excessive_cfml.expected.txt │ ├── excessive_cfml2.cfc │ ├── excessive_cfml2.expected.txt │ ├── excessive_cfscript.cfc │ ├── excessive_cfscript.expected.txt │ ├── excessive_cfscript2.cfc │ └── excessive_cfscript2.expected.txt │ ├── UnusedArgument │ ├── .cflintrc │ ├── FunctionArg_550.cfc │ ├── FunctionArg_550.expected.txt │ ├── ReturnArg_573.cfc │ ├── ReturnArg_573.expected.txt │ ├── UnusedArg_418.cfc │ ├── UnusedArg_418.expected.txt │ ├── UnusedArg_573_b.cfc │ ├── UnusedArg_573_b.expected.txt │ ├── UnusedArg_593.cfc │ ├── UnusedArg_593.expected.txt │ ├── UnusedArgument_152.cfc │ ├── UnusedArgument_152.expected.txt │ ├── UnusedArgument_152b.cfc │ ├── UnusedArgument_152b.expected.txt │ ├── UnusedArgument_227.cfc │ ├── UnusedArgument_227.expected.txt │ ├── UnusedArgument_257.cfc │ ├── UnusedArgument_257.expected.txt │ ├── UnusedArgument_257b.cfc │ ├── UnusedArgument_257b.expected.txt │ ├── UnusedArgument_Case_234.cfc │ ├── UnusedArgument_Case_234.expected.txt │ ├── UnusedArgument_Case_545.cfc │ └── UnusedArgument_Case_545.expected.txt │ ├── UnusedVariable │ ├── .cflintrc │ ├── UnusedVar_593.cfc │ ├── UnusedVar_593.expected.txt │ ├── caselessVariable_242.cfc │ ├── caselessVariable_242.expected.txt │ ├── cflog_339.cfc │ ├── cflog_339.expected.txt │ ├── cfloopname_339.cfc │ ├── cfloopname_339.expected.txt │ ├── cfoutput_464.cfc │ ├── cfoutput_464.expected.txt │ ├── cfquery_339.cfc │ ├── cfquery_339.expected.txt │ ├── cfqueryname_339.cfc │ ├── cfqueryname_339.expected.txt │ ├── cookie_339.cfc │ ├── cookie_339.expected.txt │ ├── forLoop_211.cfc │ ├── forLoop_211.expected.txt │ ├── forLoop_227.cfc │ ├── forLoop_227.expected.txt │ ├── httpparam_593.cfc │ ├── httpparam_593.expected.txt │ ├── local_339.cfc │ ├── local_339.expected.txt │ ├── local_leftuse_592.cfc │ ├── local_leftuse_592.expected.txt │ ├── local_nested_592.cfc │ ├── local_nested_592.expected.txt │ ├── local_simple_592.cfc │ ├── local_simple_592.expected.txt │ ├── local_simple_cfml_593.cfc │ ├── local_simple_cfml_593.expected.txt │ ├── location_339.cfc │ ├── location_339.expected.txt │ ├── loop_631.cfc │ ├── loop_631.expected.txt │ ├── loop_list_339.cfc │ ├── loop_list_339.expected.txt │ ├── newobj_640.cfc │ ├── newobj_640.expected.txt │ ├── sampleQuery_577.cfc │ ├── sampleQuery_577.expected.txt │ ├── simpleUnused.cfc │ ├── simpleUnused.expected.txt │ ├── transaction_497.cfc │ ├── transaction_497.expected.txt │ ├── while_465.cfc │ └── while_465.expected.txt │ ├── VarScoper │ ├── .cflintrc │ ├── 482_cfmail.cfc │ ├── 482_cfmail.expected.txt │ ├── 482_mail.cfc │ ├── 482_mail.expected.txt │ ├── 553_catch.cfc │ ├── 553_catch.expected.txt │ ├── 553_cfml_catch.cfc │ ├── 553_cfml_catch.expected.txt │ ├── cfcookie_518.cfc │ ├── cfcookie_518.expected.txt │ ├── cfdocumentsection_462.cfc │ ├── cfdocumentsection_462.expected.txt │ ├── cfloop_index_413.cfc │ ├── cfloop_index_413.expected.txt │ ├── cfquery_scoper.cfc │ ├── cfquery_scoper.expected.txt │ ├── cfqueryparam_569.cfc │ ├── cfqueryparam_569.expected.txt │ ├── cftag_483_1.cfc │ ├── cftag_483_1.expected.txt │ ├── cftag_483_2.cfc │ ├── cftag_483_2.expected.txt │ ├── cftag_483_3.cfc │ ├── cftag_483_3.expected.txt │ ├── cftry.cfc │ ├── cftry.expected.txt │ ├── for_each.cfc │ ├── for_each.expected.txt │ ├── fpositive │ │ ├── .cflintrc │ │ ├── cfthread.cfc │ │ ├── cfthread.expected.txt │ │ ├── constructor.cfc │ │ ├── constructor.expected.txt │ │ ├── expectation.cfc │ │ ├── expectation.expected.txt │ │ ├── http.cfc │ │ ├── http.expected.txt │ │ ├── http2.cfc │ │ ├── http2.expected.txt │ │ ├── mail.cfc │ │ ├── mail.expected.txt │ │ ├── query.cfc │ │ ├── query.expected.txt │ │ ├── tag.cfc │ │ └── tag.expected.txt │ ├── local_256.cfc │ ├── local_256.expected.txt │ ├── lock_488.cfc │ ├── lock_488.expected.txt │ ├── namedArgs.cfc │ ├── namedArgs.expected.txt │ ├── property_246.cfc │ ├── property_246.expected.txt │ ├── pureScript.cfc │ ├── pureScript.expected.txt │ ├── scopesUse_404.cfc │ ├── scopesUse_404.expected.txt │ ├── scriptSample186.cfc │ ├── scriptSample186.expected.txt │ ├── scripttags │ │ ├── .cflintrc │ │ ├── cfhttp.cfc │ │ └── cfhttp.expected.txt │ ├── structUse2_404.cfc │ ├── structUse2_404.expected.txt │ ├── structUse_404.cfc │ ├── structUse_404.expected.txt │ ├── structassignment.cfc │ ├── structassignment.expected.txt │ ├── structureKeys_197.cfc │ ├── structureKeys_197.expected.txt │ ├── structure_keys_197.cfc │ ├── structure_keys_197.expected.txt │ ├── testParse.cfc │ └── testParse.expected.txt │ ├── VariableNameChecker │ ├── .cflintrc │ ├── 532_naming.cfc │ ├── 532_naming.expected.txt │ ├── cftry.cfc │ ├── cftry.expected.txt │ ├── componentID_499.cfc │ ├── componentID_499.expected.txt │ ├── config │ │ ├── .cflintrc │ │ ├── length_314.cfc │ │ └── length_314.expected.txt │ ├── config2 │ │ ├── .cflintrc │ │ ├── length_314.cfc │ │ └── length_314.expected.txt │ ├── leaderboard_450.cfc │ ├── leaderboard_450.expected.txt │ ├── local_537.cfm │ ├── local_537.expected.txt │ ├── query_naming_blank_601.cfc │ ├── query_naming_blank_601.expected.txt │ ├── query_naming_hash_601.cfc │ ├── query_naming_hash_601.expected.txt │ ├── sample1_228.cfc │ ├── sample1_228.expected.txt │ ├── sample1_635.cfc │ ├── sample1_635.expected.txt │ ├── sample_239.cfc │ ├── sample_239.expected.txt │ ├── scope_608.cfc │ ├── scope_608.expected.txt │ ├── task_476.cfc │ ├── task_476.expected.txt │ ├── thisTag_479.cfc │ └── thisTag_479.expected.txt │ └── WriteDumpChecker │ ├── .cflintrc │ ├── output_hash_625.cfc │ ├── output_hash_625.expected.txt │ ├── script_hash_625.cfc │ ├── script_hash_625.expected.txt │ ├── writeDump.cfc │ └── writeDump.expected.txt └── sample.build.xml /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | insert_final_newline = false 6 | indent_style = space 7 | indent_size = 4 8 | -------------------------------------------------------------------------------- /.externalToolBuilders/.gitignore: -------------------------------------------------------------------------------- 1 | /org.eclipse.jdt.core.javabuilder.launch 2 | -------------------------------------------------------------------------------- /.github/workflows/gradle.yml: -------------------------------------------------------------------------------- 1 | name: Gradle 2 | 3 | on: 4 | pull_request: 5 | branches: 6 | - main 7 | - master 8 | - dev 9 | 10 | jobs: 11 | gradle: 12 | strategy: 13 | matrix: 14 | os: [ubuntu-latest, macos-latest, windows-latest] 15 | runs-on: ${{ matrix.os }} 16 | steps: 17 | - name: Checkout 18 | uses: actions/checkout@v4 19 | 20 | - name: Set up JDK 8 21 | uses: actions/setup-java@v4 22 | with: 23 | distribution: temurin 24 | java-version: 8 25 | 26 | - name: Setup Gradle 27 | uses: gradle/actions/setup-gradle@v3 28 | with: 29 | gradle-version: wrapper 30 | 31 | - name: Build with Gradle 32 | run: ./gradlew build -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /cfbugs 2 | /bin 3 | /out 4 | /target 5 | /.classpath 6 | /.project 7 | /.settings/ 8 | .gradle/**/* 9 | /build 10 | .idea/ 11 | /.gradle/ 12 | *.iml 13 | .scannerwork 14 | user.properties 15 | /cflint-result.html 16 | /cflint-result.json 17 | /cflint-result.txt 18 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM gradle:4.7.0-jdk8-alpine AS build 2 | COPY --chown=gradle:gradle . /home/gradle/src 3 | WORKDIR /home/gradle/src 4 | RUN gradle build -x test --no-daemon 5 | 6 | FROM openjdk:8-jre-slim 7 | 8 | RUN mkdir /app 9 | 10 | COPY --from=build /home/gradle/src/build/libs/CFLint*-all.jar /app/CFLint.jar 11 | 12 | ENTRYPOINT ["java", "-XX:+UnlockExperimentalVMOptions", "-XX:+UseCGroupMemoryLimitForHeap", "-Djava.security.egd=file:/dev/./urandom","-jar","/app/CFLint.jar"] -------------------------------------------------------------------------------- /build-instructions.md: -------------------------------------------------------------------------------- 1 | #### Dependencies 2 | CFLint is built with: Gradle 3 | 4 | #### Building CFLint 5 | ``` 6 | git clone https://github.com/cflint/CFLint.git 7 | cd CFLint 8 | gradlew build 9 | ``` 10 | 11 | The build artifacts can be found in *build/libs*. 12 | 13 | #### Building CFParser *(optional)* 14 | The build will pull cfparser from maven central repository. However if you want to build cfparser separately see https://github.com/cfparser/cfparser 15 | 16 | If you have issues, please let us know. 17 | -------------------------------------------------------------------------------- /deploy.gradle: -------------------------------------------------------------------------------- 1 | configurations { 2 | jaxDoclet 3 | } 4 | 5 | nexus { 6 | sign = true 7 | repositoryUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2/' 8 | snapshotRepositoryUrl = 'https://oss.sonatype.org/content/repositories/snapshots/' 9 | } 10 | 11 | task deploy() { 12 | if (release.toBoolean() == true) { 13 | def strippedSnapshotVersion = version.replaceFirst(/-SNAPSHOT/, '') 14 | ant.propertyfile(file: "gradle.properties") { 15 | entry( key: "version", value: "$strippedSnapshotVersion") 16 | entry( key: "release", value: "false") 17 | } 18 | } 19 | else if (snapshot.toBoolean() == true) { 20 | def strippedSnapshotVersion = version.replaceFirst(/-SNAPSHOT/, '') 21 | ant.propertyfile(file: "gradle.properties") { 22 | entry( key: "version", value: "$strippedSnapshotVersion-SNAPSHOT") 23 | entry( key: "snapshot", value: "false") 24 | } 25 | } 26 | } 27 | 28 | uploadArchives.mustRunAfter deploy 29 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | #Tue, 06 Oct 2015 20:08:05 -0600 2 | group=com.github.cflint 3 | version=1.5.0-SNAPSHOT 4 | name=CFLint 5 | release=false 6 | snapshot=false 7 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cflint/CFLint/4a5d8a2ed57e51aa041f43a0640399cac488202e/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.4-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /logo/logo.ai: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cflint/CFLint/4a5d8a2ed57e51aa041f43a0640399cac488202e/logo/logo.ai -------------------------------------------------------------------------------- /logo/logo.eps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cflint/CFLint/4a5d8a2ed57e51aa041f43a0640399cac488202e/logo/logo.eps -------------------------------------------------------------------------------- /logo/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cflint/CFLint/4a5d8a2ed57e51aa041f43a0640399cac488202e/logo/logo.png -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'CFLint' 2 | -------------------------------------------------------------------------------- /src/main/ant/build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/main/assembly/archive.xml: -------------------------------------------------------------------------------- 1 | 2 | archive 3 | 4 | zip 5 | 6 | 7 | 8 | ${project.build.directory}/appassembler 9 | / 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/main/config/cflintexclude.json: -------------------------------------------------------------------------------- 1 | [ 2 | {"function":"init", "code":"MISSING_VAR"} 3 | ] -------------------------------------------------------------------------------- /src/main/config/log4j.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/main/java/com/cflint/Bugs.java: -------------------------------------------------------------------------------- 1 | package com.cflint; 2 | 3 | /** 4 | * A few commonly use constants used when referring to bugs. 5 | */ 6 | public class Bugs { 7 | /** 8 | * Count. 9 | */ 10 | public static final String COUNT = "count"; 11 | 12 | /** 13 | * Code. 14 | */ 15 | public static final String CODE = "code"; 16 | 17 | /** 18 | * ID. 19 | */ 20 | public static final String ID = "id"; 21 | 22 | /** 23 | * Issue. 24 | */ 25 | public static final String ISSUE = "issue"; 26 | 27 | /** 28 | * Severity. 29 | */ 30 | public static final String SEVERITY = "severity"; 31 | 32 | private Bugs() { 33 | throw new IllegalStateException("Bugs utility class"); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/cflint/Levels.java: -------------------------------------------------------------------------------- 1 | package com.cflint; 2 | 3 | public enum Levels { 4 | FATAL("FATAL"), 5 | CRITICAL("CRITICAL"), 6 | ERROR("ERROR"), 7 | WARNING("WARNING"), 8 | CAUTION("CAUTION"), 9 | INFO("INFO"), 10 | COSMETIC("COSMETIC"), 11 | UNKNOWN("UNKNOWN"); 12 | 13 | private final String severity; 14 | 15 | private Levels(final String name) { 16 | severity = name; 17 | } 18 | 19 | @Override 20 | public String toString() { 21 | if (severity == null || this == UNKNOWN) { 22 | return ""; 23 | } 24 | 25 | return this.severity; 26 | } 27 | 28 | public static Levels fromString(final String severity) { 29 | for (Levels level : Levels.values()) { 30 | if (level.toString().equals(severity)) { 31 | return level; 32 | } 33 | } 34 | 35 | return UNKNOWN; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/cflint/Version.java: -------------------------------------------------------------------------------- 1 | package com.cflint; 2 | 3 | import com.cflint.cli.CFLintCLI; 4 | 5 | public class Version { 6 | 7 | private Version() { 8 | throw new IllegalStateException("Version utility class"); 9 | } 10 | 11 | public static String getVersion() { 12 | 13 | String version = CFLintCLI.class.getPackage().getImplementationVersion(); 14 | if (version != null) { 15 | return version; 16 | } else { 17 | return ""; 18 | } 19 | 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/cflint/exception/CFLintConfigurationException.java: -------------------------------------------------------------------------------- 1 | package com.cflint.exception; 2 | 3 | /** 4 | * Exception class to report errors in the CFLint configuration 5 | * 6 | */ 7 | public class CFLintConfigurationException extends Exception { 8 | 9 | /** 10 | * 11 | */ 12 | private static final long serialVersionUID = 1L; 13 | 14 | public CFLintConfigurationException(final String arg0, final Throwable arg1) { 15 | super(arg0, arg1); 16 | } 17 | 18 | public CFLintConfigurationException(final String arg0) { 19 | super(arg0); 20 | } 21 | 22 | public CFLintConfigurationException(final Throwable arg0) { 23 | super(arg0); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/cflint/exception/CFLintScanException.java: -------------------------------------------------------------------------------- 1 | package com.cflint.exception; 2 | 3 | /** 4 | * Class to report exceptions in CFLint scanning. 5 | * 6 | */ 7 | public class CFLintScanException extends Exception { 8 | 9 | /** 10 | * 11 | */ 12 | private static final long serialVersionUID = 1L; 13 | 14 | public CFLintScanException(final String arg0, final Throwable arg1) { 15 | super(arg0, arg1); 16 | } 17 | 18 | public CFLintScanException(final String arg0) { 19 | super(arg0); 20 | } 21 | 22 | public CFLintScanException(final Throwable arg0) { 23 | super(arg0); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/cflint/listeners/ScanProgressListener.java: -------------------------------------------------------------------------------- 1 | package com.cflint.listeners; 2 | 3 | /** 4 | * Receives actions when a new source (file) is processed. 5 | */ 6 | public interface ScanProgressListener { 7 | 8 | void startedProcessing(String srcidentifier); 9 | 10 | void finishedProcessing(String srcidentifier); 11 | 12 | void close(); 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/cflint/main/CFLintMain.java: -------------------------------------------------------------------------------- 1 | package com.cflint.main; 2 | 3 | import com.cflint.cli.CFLintCLI; 4 | 5 | /** 6 | * 7 | * Replaced by more aptly named cli.CFLintCLI 8 | * 9 | */ 10 | @Deprecated() 11 | public class CFLintMain extends CFLintCLI{ 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/cflint/plugins/CFLintScanner.java: -------------------------------------------------------------------------------- 1 | package com.cflint.plugins; 2 | 3 | import com.cflint.BugList; 4 | 5 | import cfml.parsing.cfscript.CFExpression; 6 | import cfml.parsing.cfscript.script.CFScriptStatement; 7 | import net.htmlparser.jericho.Element; 8 | 9 | public interface CFLintScanner { 10 | 11 | void expression(CFExpression expression, Context context, BugList bugs); 12 | 13 | void element(Element element, Context context, BugList bugs); 14 | 15 | void expression(CFScriptStatement expression, Context context, BugList bugs); 16 | 17 | void setParameter(String name, Object value); 18 | 19 | void startFile(String fileName, BugList bugs); 20 | 21 | void endFile(String fileName, BugList bugs); 22 | 23 | void startComponent(Context context, BugList bugs); 24 | 25 | void endComponent(Context context, BugList bugs); 26 | 27 | void startFunction(Context context, BugList bugs); 28 | 29 | void endFunction(Context context, BugList bugs); 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/cflint/plugins/CFLintSet.java: -------------------------------------------------------------------------------- 1 | package com.cflint.plugins; 2 | 3 | import com.cflint.CFLint; 4 | 5 | public interface CFLintSet { 6 | 7 | void setCFLint(CFLint cflint); 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/com/cflint/plugins/core/AbortChecker.java: -------------------------------------------------------------------------------- 1 | package com.cflint.plugins.core; 2 | 3 | import com.cflint.BugList; 4 | import com.cflint.plugins.CFLintScannerAdapter; 5 | import com.cflint.plugins.Context; 6 | 7 | import cfml.parsing.cfscript.script.CFAbortStatement; 8 | import cfml.parsing.cfscript.script.CFScriptStatement; 9 | import ro.fortsoft.pf4j.Extension; 10 | 11 | @Extension 12 | public class AbortChecker extends CFLintScannerAdapter { 13 | @Override 14 | public void expression(final CFScriptStatement expression, final Context context, final BugList bugs) { 15 | if (expression instanceof CFAbortStatement) { 16 | context.addMessage("AVOID_USING_ABORT", null); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/cflint/plugins/core/BuiltInFunctionChecker.java: -------------------------------------------------------------------------------- 1 | package com.cflint.plugins.core; 2 | 3 | import com.cflint.BugList; 4 | import com.cflint.plugins.CFLintScannerAdapter; 5 | import com.cflint.plugins.Context; 6 | 7 | import cfml.parsing.cfscript.CFExpression; 8 | import cfml.parsing.cfscript.CFFunctionExpression; 9 | import ro.fortsoft.pf4j.Extension; 10 | 11 | /** 12 | * isDate() is too permissive. Avoid it. 13 | */ 14 | @Extension 15 | public class BuiltInFunctionChecker extends CFLintScannerAdapter { 16 | 17 | @Override 18 | public void expression(final CFExpression expression, final Context context, final BugList bugs) { 19 | if (expression instanceof CFFunctionExpression) { 20 | final CFFunctionExpression functionExpression = (CFFunctionExpression) expression; 21 | if ("isDate".equalsIgnoreCase(functionExpression.getName())) { 22 | context.addMessage("AVOID_USING_ISDATE", null); 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/cflint/plugins/core/CFXTagChecker.java: -------------------------------------------------------------------------------- 1 | package com.cflint.plugins.core; 2 | 3 | import com.cflint.BugList; 4 | import com.cflint.CF; 5 | import com.cflint.plugins.CFLintScannerAdapter; 6 | import com.cflint.plugins.Context; 7 | 8 | import net.htmlparser.jericho.Element; 9 | 10 | public class CFXTagChecker extends CFLintScannerAdapter { 11 | 12 | @Override 13 | public void element(final Element element, final Context context, final BugList bugs) { 14 | final String tagName = element.getName(); 15 | final String cfmlTagCheck = context.getConfiguration().getParameter(this,"tagName"); 16 | final String scope = context.getConfiguration().getParameter(this,"scope"); 17 | 18 | if (cfmlTagCheck != null && tagName.matches(cfmlTagCheck)) { 19 | if (scope == null || scope.equals(CF.COMPONENT) && context.isInComponent()) { 20 | context.addMessage("AVOID_USING_" + tagName.toUpperCase() + "_TAG", tagName); 21 | } 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/cflint/plugins/core/ConfigError.java: -------------------------------------------------------------------------------- 1 | package com.cflint.plugins.core; 2 | 3 | /** 4 | * Exception to throw if a configuration error occurs. 5 | */ 6 | public class ConfigError extends Exception { 7 | private static final long serialVersionUID = 1L; 8 | 9 | public ConfigError(final String message) { 10 | super(message); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/cflint/plugins/core/OutputParmMissing.java: -------------------------------------------------------------------------------- 1 | package com.cflint.plugins.core; 2 | 3 | import com.cflint.BugList; 4 | import com.cflint.CF; 5 | import com.cflint.plugins.CFLintScannerAdapter; 6 | import com.cflint.plugins.Context; 7 | 8 | import net.htmlparser.jericho.Element; 9 | 10 | public class OutputParmMissing extends CFLintScannerAdapter { 11 | 12 | @Override 13 | public void element(final Element element, final Context context, final BugList bugs) { 14 | if (// element.getName().equals(CF.CFCOMPONENT) || 15 | element.getName().equals(CF.CFFUNCTION)) { 16 | final String outputAttr = element.getAttributeValue(CF.OUTPUT); 17 | if (outputAttr == null) { 18 | context.addMessage("OUTPUT_ATTR", element.getAttributeValue(CF.NAME)); 19 | } 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/cflint/plugins/core/ScriptTagChecker.java: -------------------------------------------------------------------------------- 1 | package com.cflint.plugins.core; 2 | 3 | import com.cflint.BugList; 4 | import com.cflint.plugins.CFLintScannerAdapter; 5 | import com.cflint.plugins.Context; 6 | 7 | import net.htmlparser.jericho.Element; 8 | import ro.fortsoft.pf4j.Extension; 9 | 10 | // Deprecate? 11 | @Extension 12 | public class ScriptTagChecker extends CFLintScannerAdapter { 13 | 14 | // rule: don't use inline javascript in cfm and cfc files 15 | @Override 16 | public void element(final Element element, final Context context, final BugList bugs) { 17 | if ("script".equals(element.getName())) { 18 | final String src = element.getStartTag().toString(); 19 | if (!src.matches(".*src=.*")) { 20 | context.addMessage("AVOID_USING_INLINE_JS", null); 21 | } 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/cflint/plugins/core/SelectStarChecker.java: -------------------------------------------------------------------------------- 1 | package com.cflint.plugins.core; 2 | 3 | import com.cflint.BugList; 4 | import com.cflint.CF; 5 | import com.cflint.plugins.CFLintScannerAdapter; 6 | import com.cflint.plugins.Context; 7 | 8 | import net.htmlparser.jericho.Element; 9 | import ro.fortsoft.pf4j.Extension; 10 | 11 | @Extension 12 | public class SelectStarChecker extends CFLintScannerAdapter { 13 | private static final CharSequence selectStar = "select*"; 14 | 15 | @Override 16 | public void element(final Element element, final Context context, final BugList bugs) { 17 | final String tagName = element.getName(); 18 | if (tagName.equals(CF.CFQUERY)) { 19 | 20 | String queryGuts = element.getContent().toString().replaceAll("\\s+", ""); 21 | queryGuts = queryGuts.toLowerCase(); 22 | 23 | if (queryGuts.contains(selectStar)) { 24 | context.addMessage("SQL_SELECT_STAR", null); 25 | } 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/cflint/plugins/core/TypedQueryNew.java: -------------------------------------------------------------------------------- 1 | package com.cflint.plugins.core; 2 | 3 | import com.cflint.BugList; 4 | import com.cflint.plugins.CFLintScannerAdapter; 5 | import com.cflint.plugins.Context; 6 | 7 | import cfml.parsing.cfscript.CFExpression; 8 | import cfml.parsing.cfscript.CFFunctionExpression; 9 | 10 | public class TypedQueryNew extends CFLintScannerAdapter { 11 | 12 | @Override 13 | public void expression(final CFExpression expression, final Context context, final BugList bugs) { 14 | if (expression instanceof CFFunctionExpression) { 15 | final CFFunctionExpression cfFunctionExpr = (CFFunctionExpression) expression; 16 | if ("QueryNew".equalsIgnoreCase(cfFunctionExpr.getName()) && cfFunctionExpr.getArgs().size() == 1) { 17 | context.addMessage("QUERYNEW_DATATYPE", cfFunctionExpr.getName()); 18 | } 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/cflint/plugins/exceptions/CFLintExceptionListener.java: -------------------------------------------------------------------------------- 1 | package com.cflint.plugins.exceptions; 2 | 3 | public interface CFLintExceptionListener { 4 | 5 | public void exceptionOccurred(Throwable exception, String messageCode, String filename, Integer line, 6 | Integer column, String functionName, String expression); 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/com/cflint/tools/ObjectEquals.java: -------------------------------------------------------------------------------- 1 | package com.cflint.tools; 2 | 3 | public class ObjectEquals { 4 | 5 | private ObjectEquals() { 6 | throw new IllegalStateException("ObjectEquals utility class"); 7 | } 8 | 9 | public static boolean equals(final Object a, final Object b) { 10 | if (a == null) { 11 | return b == null; 12 | } else { 13 | return a.equals(b); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/cflint/xml/CFLintResultMarshaller.java: -------------------------------------------------------------------------------- 1 | package com.cflint.xml; 2 | 3 | import java.io.Writer; 4 | 5 | import com.cflint.BugList; 6 | import com.cflint.CFLintStats; 7 | 8 | public interface CFLintResultMarshaller { 9 | 10 | public void output(final BugList bugList, final Writer writer, final CFLintStats stats) throws MarshallerException; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/cflint/xml/MarshallerException.java: -------------------------------------------------------------------------------- 1 | package com.cflint.xml; 2 | 3 | public class MarshallerException extends Exception { 4 | 5 | /** 6 | * 7 | */ 8 | private static final long serialVersionUID = 1L; 9 | 10 | public MarshallerException() { 11 | } 12 | 13 | public MarshallerException(final String message) { 14 | super(message); 15 | } 16 | 17 | public MarshallerException(final String message, final Throwable cause) { 18 | super(message, cause); 19 | } 20 | 21 | public MarshallerException(final Throwable cause) { 22 | super(cause); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/resources/CFLint-logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cflint/CFLint/4a5d8a2ed57e51aa041f43a0640399cac488202e/src/main/resources/CFLint-logo.jpg -------------------------------------------------------------------------------- /src/main/resources/changelog.mustache: -------------------------------------------------------------------------------- 1 | History 2 | 3 | ======= 4 | 5 | 6 | {{#tags}} 7 | ## {{name}} {{date}} 8 | {{#issues}} 9 | {{#hasIssue}} 10 | {{#hasLink}} 11 | ##### {{name}} [{{issue}}]({{link}}) {{title}} 12 | {{/hasLink}} 13 | {{^hasLink}} 14 | ##### {{name}} {{issue}} {{title}} 15 | {{/hasLink}} 16 | {{/hasIssue}} 17 | {{^hasIssue}} 18 | ##### {{name}} 19 | {{/hasIssue}} 20 | {{/issues}} 21 | {{/tags}} -------------------------------------------------------------------------------- /src/main/resources/com/cflint/cflint.properties: -------------------------------------------------------------------------------- 1 | allowedextensions=.cfm,.cfc -------------------------------------------------------------------------------- /src/main/resources/logos/CFLint-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cflint/CFLint/4a5d8a2ed57e51aa041f43a0640399cac488202e/src/main/resources/logos/CFLint-logo.png -------------------------------------------------------------------------------- /src/main/resources/logos/largelogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cflint/CFLint/4a5d8a2ed57e51aa041f43a0640399cac488202e/src/main/resources/logos/largelogo.png -------------------------------------------------------------------------------- /src/main/resources/logos/logo24x24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cflint/CFLint/4a5d8a2ed57e51aa041f43a0640399cac488202e/src/main/resources/logos/logo24x24.png -------------------------------------------------------------------------------- /src/main/resources/scripts/getLatestTag.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | git tag -l --format="%(creatordate:iso8601)|%(refname:short)" | sort -r | head -n 1 | awk -F'|' '{print $2}' 3 | -------------------------------------------------------------------------------- /src/main/resources/scripts/writeChangelog.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | $1 -u cflint -p CFLint --token $2 --output CHANGELOG.md --base CHANGELOG.md --no-unreleased --since-tag $3 --header-label 3 | -------------------------------------------------------------------------------- /src/test/java/com/cflint/tools/TestCFLintDoc.java: -------------------------------------------------------------------------------- 1 | package com.cflint.tools; 2 | 3 | import java.io.PrintWriter; 4 | import java.io.StringWriter; 5 | 6 | import org.junit.Ignore; 7 | import org.junit.Test; 8 | 9 | import com.cflint.config.CFLintPluginInfo; 10 | import com.cflint.config.ConfigUtils; 11 | 12 | public class TestCFLintDoc { 13 | 14 | @Test 15 | @Ignore 16 | public void test(){ 17 | final CFLintPluginInfo pluginInfo = ConfigUtils.loadDefaultPluginInfo(); 18 | StringWriter out = new StringWriter(); 19 | PrintWriter print = new PrintWriter(out); 20 | CFLintDoc.generateRuleMarkDown(pluginInfo, print); 21 | System.out.println(out); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/integration/.cflintrc: -------------------------------------------------------------------------------- 1 | { 2 | "rule" : [ ], 3 | "excludes" : [ ], 4 | "includes" : [ { 5 | "code" : "FUNCTION_HINT_MISSING", 6 | "messageText" : null, 7 | "severity" : null 8 | } ], 9 | "inheritParent" : false 10 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/integration/.gitignore: -------------------------------------------------------------------------------- 1 | /output.json 2 | /output.rulegroup.json 3 | /output_194.json 4 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/integration/inherit/.cflintrc: -------------------------------------------------------------------------------- 1 | { 2 | "rule" : [ ], 3 | "excludes" : [ ], 4 | "includes" : [ { 5 | "code" : "FUNCTION_HINT_MISSING", 6 | "messageText" : null, 7 | "severity" : null 8 | }, { 9 | "code" : "COMPONENT_INVALID_NAME", 10 | "messageText" : null, 11 | "severity" : null 12 | } ], 13 | "inheritParent" : true 14 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/integration/inherit/test.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | public string function getStringFromStruct(any interestingVar) { 3 | return interestingVar; 4 | } 5 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/integration/output.rulegroup.expected.json: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 0, 4 | "issues" : [ { 5 | "severity" : "INFO", 6 | "id" : "COMPONENT_INVALID_NAME", 7 | "message" : "COMPONENT_INVALID_NAME", 8 | "category" : "CFLINT", 9 | "abbrev" : "CI", 10 | "locations" : [ { 11 | "fileName" : "test.cfc", 12 | "function" : "", 13 | "offset" : 0, 14 | "column" : 0, 15 | "line" : 1, 16 | "message" : "Component name test is not a valid name. Please use PascalCase and start with a capital letter.", 17 | "variable" : "", 18 | "expression" : "component {/n public string function getStringFromStruct(interestingVar) {/n return interestingVar;/n/n }/n}" 19 | } ] 20 | } ], 21 | "counts" : { 22 | "totalFiles" : 3, 23 | "totalLines" : 18, 24 | "countByCode" : [ { 25 | "code" : "COMPONENT_INVALID_NAME", 26 | "count" : 1 27 | } ], 28 | "countBySeverity" : [ { 29 | "severity" : "INFO", 30 | "count" : 1 31 | } ] 32 | } 33 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/integration/output_194.expected.json: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 0, 4 | "issues" : [ { 5 | "severity" : "INFO", 6 | "id" : "COMPONENT_INVALID_NAME", 7 | "message" : "COMPONENT_INVALID_NAME", 8 | "category" : "CFLINT", 9 | "abbrev" : "CI", 10 | "locations" : [ { 11 | "fileName" : "test.cfc", 12 | "function" : "", 13 | "offset" : 0, 14 | "column" : 0, 15 | "line" : 1, 16 | "message" : "Component name test is not a valid name. Please use PascalCase and start with a capital letter.", 17 | "variable" : "", 18 | "expression" : "component {/n public string function getStringFromStruct(interestingVar) {/n return interestingVar;/n/n }/n}" 19 | } ] 20 | } ], 21 | "counts" : { 22 | "totalFiles" : 3, 23 | "totalLines" : 18, 24 | "countByCode" : [ { 25 | "code" : "COMPONENT_INVALID_NAME", 26 | "count" : 1 27 | } ], 28 | "countBySeverity" : [ { 29 | "severity" : "INFO", 30 | "count" : 1 31 | } ] 32 | } 33 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/integration/standalone/.cflintrc: -------------------------------------------------------------------------------- 1 | { 2 | "rule" : [ ], 3 | "excludes" : [ ], 4 | "includes" : [ { 5 | "code" : "FUNCTION_HINT_MISSING", 6 | "messageText" : null, 7 | "severity" : null 8 | } ], 9 | "inheritParent" : false 10 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/integration/standalone/test.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | public string function getStringFromStruct(any interestingVar) { 3 | return interestingVar; 4 | } 5 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/integration/test.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | public string function getStringFromStruct(any interestingVar) { 3 | return interestingVar; 4 | } 5 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/test.properties: -------------------------------------------------------------------------------- 1 | #Change the AutoReplaceFailedTestResults to Y to pass the test and replace the expected results 2 | #AutoReplaceFailedTestResults=N 3 | #Uncomment the following line to run only the last updated test file. 4 | #RunSingleTest=*LAST 5 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/ArgVarChecker/.cflintrc: -------------------------------------------------------------------------------- 1 | { 2 | "includes" : [ { 3 | "code" : "ARG_VAR_MIXED" 4 | },{ 5 | "code" : "ARG_VAR_CONFLICT" 6 | } ], 7 | "inheritParent" : false 8 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/ArgVarChecker/cfc_540.cfc: -------------------------------------------------------------------------------- 1 | component{ 2 | property name="name" type="string"; 3 | /** 4 | * This is a hint. 5 | * @name A name 6 | */ 7 | public string function sayHello(required string name) { 8 | return "Hello, " & arguments.name; 9 | } 10 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/ArgVarChecker/cfc_540.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1568692189, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/ArgVarChecker/cfc_540_b.cfc: -------------------------------------------------------------------------------- 1 | component{ 2 | property name="name" type="string"; 3 | /** 4 | * This is a hint. 5 | * @name A name 6 | */ 7 | public string function sayHello(required string name) { 8 | local.name='foo'; 9 | return "Hello, " & arguments.name; 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/ArgVarChecker/cfc_540_b.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1568693673, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/ArgVarChecker/cfc_540_c.cfc: -------------------------------------------------------------------------------- 1 | component{ 2 | property name="name" type="string"; 3 | /** 4 | * This is a hint. 5 | * @name A name 6 | */ 7 | public string function sayHello(required string name) { 8 | var name='foo'; 9 | return "Hello, " & arguments.name; 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/ArgVarChecker/cfc_540_c.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 0, 4 | "issues" : [ { 5 | "severity" : "ERROR", 6 | "id" : "ARG_VAR_CONFLICT", 7 | "message" : "ARG_VAR_CONFLICT", 8 | "category" : "CFLINT", 9 | "abbrev" : "AV", 10 | "locations" : [ { 11 | "file" : "src/test/resources/com/cflint/tests/ArgVarChecker/cfc_540_c.cfc", 12 | "fileName" : "cfc_540_c.cfc", 13 | "function" : "sayHello", 14 | "offset" : 155, 15 | "column" : 7, 16 | "line" : 8, 17 | "message" : "Variable name should not be declared in both local and argument scopes.", 18 | "variable" : "name", 19 | "expression" : "name" 20 | } ] 21 | } ], 22 | "counts" : { 23 | "totalFiles" : 0, 24 | "totalLines" : 0, 25 | "countByCode" : [ { 26 | "code" : "ARG_VAR_CONFLICT", 27 | "count" : 1 28 | } ], 29 | "countBySeverity" : [ { 30 | "severity" : "ERROR", 31 | "count" : 1 32 | } ] 33 | } 34 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/ArgVarChecker/cfc_540_d.cfc: -------------------------------------------------------------------------------- 1 | component{ 2 | property name="name" type="string"; 3 | /** 4 | * This is a hint. 5 | * @name A name 6 | */ 7 | public string function sayHello(required string name) { 8 | name='foo'; 9 | return "Hello, " & arguments.name; 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/ArgVarChecker/cfc_540_d.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 0, 4 | "issues" : [ { 5 | "severity" : "ERROR", 6 | "id" : "ARG_VAR_CONFLICT", 7 | "message" : "ARG_VAR_CONFLICT", 8 | "category" : "CFLINT", 9 | "abbrev" : "AV", 10 | "locations" : [ { 11 | "file" : "src/test/resources/com/cflint/tests/ArgVarChecker/cfc_540_d.cfc", 12 | "fileName" : "cfc_540_d.cfc", 13 | "function" : "sayHello", 14 | "offset" : 151, 15 | "column" : 3, 16 | "line" : 8, 17 | "message" : "Variable name should not be declared in both local and argument scopes.", 18 | "variable" : "name", 19 | "expression" : "name" 20 | } ] 21 | } ], 22 | "counts" : { 23 | "totalFiles" : 0, 24 | "totalLines" : 0, 25 | "countByCode" : [ { 26 | "code" : "ARG_VAR_CONFLICT", 27 | "count" : 1 28 | } ], 29 | "countBySeverity" : [ { 30 | "severity" : "ERROR", 31 | "count" : 1 32 | } ] 33 | } 34 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/ArgVarChecker/cfml_540.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/ArgVarChecker/cfml_540.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1568690862, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/ArgVarChecker/implicitStructKey_478.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | var mystructure = {myvariable = arguments.myvariable}; 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/ArgVarChecker/implicitStructKey_478.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095017, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/ArgVarChecker/mixed_471.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | var id = arguments.myvar; 6 | var name = myvar; 7 | var id2 = arguments.myvar; 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/ArgVarChecker/mixed_471.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1568522069, 4 | "issues" : [ { 5 | "severity" : "INFO", 6 | "id" : "ARG_VAR_MIXED", 7 | "message" : "ARG_VAR_MIXED", 8 | "category" : "CFLINT", 9 | "abbrev" : "AV", 10 | "locations" : [ { 11 | "file" : "src\\test\\resources\\com\\cflint\\tests\\ArgVarChecker\\mixed_471.cfc", 12 | "fileName" : "mixed_471.cfc", 13 | "function" : "foo", 14 | "offset" : 226, 15 | "column" : 24, 16 | "line" : 6, 17 | "message" : "Variable myvar should not be referenced in local and argument scope.", 18 | "variable" : "myvar", 19 | "expression" : "myvar" 20 | } ] 21 | } ], 22 | "counts" : { 23 | "totalFiles" : 0, 24 | "totalLines" : 0, 25 | "countByCode" : [ { 26 | "code" : "ARG_VAR_MIXED", 27 | "count" : 1 28 | } ], 29 | "countBySeverity" : [ { 30 | "severity" : "INFO", 31 | "count" : 1 32 | } ] 33 | } 34 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/ArgVarConflict/.cflintrc: -------------------------------------------------------------------------------- 1 | { 2 | "rule" : [ ], 3 | "excludes" : [ ], 4 | "includes" : [ { 5 | "code" : "ARG_VAR_CONFLICT", 6 | "messageText" : null, 7 | "severity" : null 8 | } ], 9 | "inheritParent" : false 10 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/ArgVarConflict/mixedScopeExample.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | var qryChildren = querynew('id,label,threshold,type,refid,multiple,iterative,alt,next,previous'); 8 | var pageChildrenAry = arraynew(1); 9 | var i = {}; 10 | var p = {}; 11 | var stcA = ''; 12 | var pagesAry = xmlSearch(xml,"/Manual/PageSequence//Page"); 13 | var id = ''; 14 | variables.instance.pagechildren = {}; 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/ArgVarConflict/mixedScopeExample.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095018, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/BuiltInFunctionChecker/.cflintrc: -------------------------------------------------------------------------------- 1 | { 2 | "rule" : [ ], 3 | "excludes" : [ ], 4 | "includes" : [ { 5 | "code" : "AVOID_USING_ISDATE", 6 | "messageText" : null, 7 | "severity" : null 8 | } ], 9 | "inheritParent" : false 10 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/BuiltInFunctionChecker/isDate1.cfm: -------------------------------------------------------------------------------- 1 | component{ 2 | function foo(){ 3 | var x = isDate(1.5); 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/BuiltInFunctionChecker/isDate1.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095019, 4 | "issues" : [ { 5 | "severity" : "WARNING", 6 | "id" : "AVOID_USING_ISDATE", 7 | "message" : "AVOID_USING_ISDATE", 8 | "category" : "CFLINT", 9 | "abbrev" : "AU", 10 | "locations" : [ { 11 | "file" : "src\\test\\resources\\com\\cflint\\tests\\BuiltInFunctionChecker\\isDate1.cfm", 12 | "fileName" : "isDate1.cfm", 13 | "function" : "foo", 14 | "offset" : 47, 15 | "column" : 17, 16 | "line" : 3, 17 | "message" : "Avoid using the isDate built-in function. It is too permissive. Use isValid() instead.", 18 | "variable" : "", 19 | "expression" : "isDate(1.5)" 20 | } ] 21 | } ], 22 | "counts" : { 23 | "totalFiles" : 0, 24 | "totalLines" : 0, 25 | "countByCode" : [ { 26 | "code" : "AVOID_USING_ISDATE", 27 | "count" : 1 28 | } ], 29 | "countBySeverity" : [ { 30 | "severity" : "WARNING", 31 | "count" : 1 32 | } ] 33 | } 34 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/BuiltInFunctionChecker/isDate2.cfm: -------------------------------------------------------------------------------- 1 | component{ 2 | function foo(d){ 3 | if( d && (isDate(1.5))){ 4 | return 123; 5 | }; 6 | return 321; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/BuiltInFunctionChecker/isDate2.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095019, 4 | "issues" : [ { 5 | "severity" : "WARNING", 6 | "id" : "AVOID_USING_ISDATE", 7 | "message" : "AVOID_USING_ISDATE", 8 | "category" : "CFLINT", 9 | "abbrev" : "AU", 10 | "locations" : [ { 11 | "file" : "src\\test\\resources\\com\\cflint\\tests\\BuiltInFunctionChecker\\isDate2.cfm", 12 | "fileName" : "isDate2.cfm", 13 | "function" : "foo", 14 | "offset" : 50, 15 | "column" : 19, 16 | "line" : 3, 17 | "message" : "Avoid using the isDate built-in function. It is too permissive. Use isValid() instead.", 18 | "variable" : "", 19 | "expression" : "isDate(1.5)" 20 | } ] 21 | } ], 22 | "counts" : { 23 | "totalFiles" : 0, 24 | "totalLines" : 0, 25 | "countByCode" : [ { 26 | "code" : "AVOID_USING_ISDATE", 27 | "count" : 1 28 | } ], 29 | "countBySeverity" : [ { 30 | "severity" : "WARNING", 31 | "count" : 1 32 | } ] 33 | } 34 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/CFDebugAttributeChecker/.cflintrc: -------------------------------------------------------------------------------- 1 | { 2 | "rule" : [ ], 3 | "excludes" : [ ], 4 | "includes" : [ 5 | {"code" : "AVOID_USING_DEBUG_ATTR"} 6 | ,{"code" : "AVOID_USING_CFSETTING_DEBUG"} 7 | ], 8 | "inheritParent" : false 9 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/CFDebugAttributeChecker/cfquery1_487.cfc: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/CFDebugAttributeChecker/cfquery1_487.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095019, 4 | "issues" : [ { 5 | "severity" : "WARNING", 6 | "id" : "AVOID_USING_DEBUG_ATTR", 7 | "message" : "AVOID_USING_DEBUG_ATTR", 8 | "category" : "CFLINT", 9 | "abbrev" : "AU", 10 | "locations" : [ { 11 | "file" : "src\\test\\resources\\com\\cflint\\tests\\CFDebugAttributeChecker\\cfquery1_487.cfc", 12 | "fileName" : "cfquery1_487.cfc", 13 | "function" : "", 14 | "offset" : 0, 15 | "column" : 1, 16 | "line" : 1, 17 | "message" : "Avoid leaving debug attribute on tags.", 18 | "variable" : "", 19 | "expression" : "" 20 | } ] 21 | } ], 22 | "counts" : { 23 | "totalFiles" : 0, 24 | "totalLines" : 0, 25 | "countByCode" : [ { 26 | "code" : "AVOID_USING_DEBUG_ATTR", 27 | "count" : 1 28 | } ], 29 | "countBySeverity" : [ { 30 | "severity" : "WARNING", 31 | "count" : 1 32 | } ] 33 | } 34 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/CFDebugAttributeChecker/cfquery2_488.cfc: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/CFDebugAttributeChecker/cfquery2_488.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095020, 4 | "issues" : [ { 5 | "severity" : "WARNING", 6 | "id" : "AVOID_USING_DEBUG_ATTR", 7 | "message" : "AVOID_USING_DEBUG_ATTR", 8 | "category" : "CFLINT", 9 | "abbrev" : "AU", 10 | "locations" : [ { 11 | "file" : "src\\test\\resources\\com\\cflint\\tests\\CFDebugAttributeChecker\\cfquery2_488.cfc", 12 | "fileName" : "cfquery2_488.cfc", 13 | "function" : "", 14 | "offset" : 0, 15 | "column" : 1, 16 | "line" : 1, 17 | "message" : "Avoid leaving debug attribute on tags.", 18 | "variable" : "", 19 | "expression" : "" 20 | } ] 21 | } ], 22 | "counts" : { 23 | "totalFiles" : 0, 24 | "totalLines" : 0, 25 | "countByCode" : [ { 26 | "code" : "AVOID_USING_DEBUG_ATTR", 27 | "count" : 1 28 | } ], 29 | "countBySeverity" : [ { 30 | "severity" : "WARNING", 31 | "count" : 1 32 | } ] 33 | } 34 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/CFDebugAttributeChecker/cfquery3_489.cfc: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/CFDebugAttributeChecker/cfquery3_489.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095020, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/CFDebugAttributeChecker/cfquery4_490.cfc: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/CFDebugAttributeChecker/cfquery4_490.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095020, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/CFDebugAttributeChecker/cfquery5_490.cfc: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/CFDebugAttributeChecker/cfquery5_490.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095020, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/CFIncludeChecker/.cflintrc: -------------------------------------------------------------------------------- 1 | { 2 | "rule" : [ ], 3 | "excludes" : [ ], 4 | "includes" : [ { 5 | "code" : "AVOID_USING_CFINCLUDE_TAG", 6 | "messageText" : null, 7 | "severity" : null 8 | } ], 9 | "inheritParent" : false 10 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/CFIncludeChecker/cfinclude1.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/CFIncludeChecker/lonelyCfinclude.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/CompareInsteadOfAssign/.cflintrc: -------------------------------------------------------------------------------- 1 | { 2 | "rule" : [ ], 3 | "excludes" : [ ], 4 | "includes" : [ { 5 | "code" : "COMPARE_INSTEAD_OF_ASSIGN", 6 | "messageText" : null, 7 | "severity" : null 8 | } ], 9 | "inheritParent" : false 10 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/CompareInsteadOfAssign/Compare1.cfm: -------------------------------------------------------------------------------- 1 | 2 | 3 | x = {}; 4 | x.x = 1; 5 | x.x == 2; 6 | if (x.x == 2){ 7 | x=123; 8 | } 9 | x.x EQ 6; 10 | b1 = x == y; 11 | b2 = x EQ y; 12 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/CompareInsteadOfAssign/Compare2.cfm: -------------------------------------------------------------------------------- 1 | 2 | 3 | y = x == 2; 4 | z = x EQ 2; 5 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/CompareInsteadOfAssign/Compare2.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095021, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Complexity/.cflintrc: -------------------------------------------------------------------------------- 1 | { 2 | "rule" : [ ], 3 | "excludes" : [ ], 4 | "includes" : [ { 5 | "code" : "PARSE_NOTHING", 6 | "messageText" : null, 7 | "severity" : null 8 | }, { 9 | "code" : "FUNCTION_TOO_COMPLEX", 10 | "messageText" : null, 11 | "severity" : null 12 | } ], 13 | "inheritParent" : false 14 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Complexity/ifelse.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | public void function foo() { 3 | if (something) { 4 | doSomething(); 5 | } else { 6 | doSomethingElse(); 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Complexity/ifelse.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095021, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Complexity/ifelseComplex.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | public void function foo() { 3 | if (something) { 4 | doSomething(); 5 | } else { 6 | if (something) { 7 | if (something) { 8 | if (something) { 9 | if (something) { 10 | if (something) { 11 | if (something) { 12 | if (something) { 13 | if (something) { 14 | if (something) { 15 | if (something) { 16 | doSomethingElse(); 17 | } 18 | } 19 | } 20 | } 21 | } 22 | } 23 | } 24 | } 25 | } 26 | } 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/ComponentNameChecker/.cflintrc: -------------------------------------------------------------------------------- 1 | { 2 | "rule" : [ ], 3 | "excludes" : [ ], 4 | "includes" : [ { 5 | "code" : "COMPONENT_INVALID_NAME", 6 | "messageText" : null, 7 | "severity" : null 8 | },{ 9 | "code" : "COMPONENT_ALLCAPS_NAME", 10 | "messageText" : null, 11 | "severity" : null 12 | },{ 13 | "code" : "COMPONENT_TOO_SHORT", 14 | "messageText" : null, 15 | "severity" : null 16 | },{ 17 | "code" : "COMPONENT_TOO_LONG", 18 | "messageText" : null, 19 | "severity" : null 20 | },{ 21 | "code" : "COMPONENT_TOO_WORDY", 22 | "messageText" : null, 23 | "severity" : null 24 | },{ 25 | "code" : "COMPONENT_IS_TEMPORARY", 26 | "messageText" : null, 27 | "severity" : null 28 | },{ 29 | "code" : "COMPONENT_HAS_PREFIX_OR_POSTFIX", 30 | "messageText" : null, 31 | "severity" : null 32 | } 33 | ], 34 | "inheritParent" : false 35 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/ComponentNameChecker/foo.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/ComponentNameChecker/foo.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095022, 4 | "issues" : [ { 5 | "severity" : "INFO", 6 | "id" : "COMPONENT_INVALID_NAME", 7 | "message" : "COMPONENT_INVALID_NAME", 8 | "category" : "CFLINT", 9 | "abbrev" : "CI", 10 | "locations" : [ { 11 | "file" : "src\\test\\resources\\com\\cflint\\tests\\ComponentNameChecker\\foo.cfc", 12 | "fileName" : "foo.cfc", 13 | "function" : "", 14 | "offset" : 0, 15 | "column" : 0, 16 | "line" : 1, 17 | "message" : "Component name foo is not a valid name. Please use PascalCase and start with a capital letter.", 18 | "variable" : "", 19 | "expression" : "component {\n}" 20 | } ] 21 | } ], 22 | "counts" : { 23 | "totalFiles" : 0, 24 | "totalLines" : 0, 25 | "countByCode" : [ { 26 | "code" : "COMPONENT_INVALID_NAME", 27 | "count" : 1 28 | } ], 29 | "countBySeverity" : [ { 30 | "severity" : "INFO", 31 | "count" : 1 32 | } ] 33 | } 34 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/ComponentNameChecker/foofoo.cfc: -------------------------------------------------------------------------------- 1 | component name="foo2"{ 2 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/ComponentNameChecker/veryLongComponentName.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/EmptyFile/.cflintrc: -------------------------------------------------------------------------------- 1 | { 2 | "rule" : [ ], 3 | "excludes" : [ ], 4 | "includes" : [ { 5 | "code" : "AVOID_EMPTY_FILES", 6 | "messageText" : null, 7 | "severity" : null 8 | }], 9 | "inheritParent" : false 10 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/EmptyFile/foo.cfc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cflint/CFLint/4a5d8a2ed57e51aa041f43a0640399cac488202e/src/test/resources/com/cflint/tests/EmptyFile/foo.cfc -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/EmptyFile/foo.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095022, 4 | "issues" : [ { 5 | "severity" : "WARNING", 6 | "id" : "AVOID_EMPTY_FILES", 7 | "message" : "AVOID_EMPTY_FILES", 8 | "category" : "CFLINT", 9 | "abbrev" : "AE", 10 | "locations" : [ { 11 | "file" : "src\\test\\resources\\com\\cflint\\tests\\EmptyFile\\foo.cfc", 12 | "fileName" : "foo.cfc", 13 | "function" : "", 14 | "offset" : 0, 15 | "column" : 1, 16 | "line" : 1, 17 | "message" : "CF file is empty: ${file}", 18 | "variable" : "", 19 | "expression" : "" 20 | } ] 21 | } ], 22 | "counts" : { 23 | "totalFiles" : 0, 24 | "totalLines" : 0, 25 | "countByCode" : [ { 26 | "code" : "AVOID_EMPTY_FILES", 27 | "count" : 1 28 | } ], 29 | "countBySeverity" : [ { 30 | "severity" : "WARNING", 31 | "count" : 1 32 | } ] 33 | } 34 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/EmptyFile/fooWS.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/EmptyFile/fooWS.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095023, 4 | "issues" : [ { 5 | "severity" : "WARNING", 6 | "id" : "AVOID_EMPTY_FILES", 7 | "message" : "AVOID_EMPTY_FILES", 8 | "category" : "CFLINT", 9 | "abbrev" : "AE", 10 | "locations" : [ { 11 | "file" : "src\\test\\resources\\com\\cflint\\tests\\EmptyFile\\fooWS.cfc", 12 | "fileName" : "fooWS.cfc", 13 | "function" : "", 14 | "offset" : 0, 15 | "column" : 1, 16 | "line" : 1, 17 | "message" : "CF file is empty: ${file}", 18 | "variable" : "", 19 | "expression" : "" 20 | } ] 21 | } ], 22 | "counts" : { 23 | "totalFiles" : 0, 24 | "totalLines" : 0, 25 | "countByCode" : [ { 26 | "code" : "AVOID_EMPTY_FILES", 27 | "count" : 1 28 | } ], 29 | "countBySeverity" : [ { 30 | "severity" : "WARNING", 31 | "count" : 1 32 | } ] 33 | } 34 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/ExcludesAll/.cflintrc: -------------------------------------------------------------------------------- 1 | { 2 | "includes" : [ { } ], 3 | "inheritParent" : false 4 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/ExcludesAll/someErrors.cfc: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | var test = ''; 9 | someVar = ''; 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/ExcludesAll/someErrors.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095023, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/FunctionCollision/.cflintrc: -------------------------------------------------------------------------------- 1 | { 2 | "rule" : [ ], 3 | "excludes" : [ ], 4 | "includes" : [ { 5 | "code" : "FUNCTION_NAME_COLLISION", 6 | "messageText" : null, 7 | "severity" : null 8 | } ], 9 | "inheritParent" : false 10 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/FunctionCollision/function_abs.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | 3 | public any function abs(){ 4 | x=123; 5 | } 6 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/FunctionCollision/function_abs_cfml.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/FunctionCollision/function_x.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | 3 | public function x(){ 4 | x=123; 5 | } 6 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/FunctionCollision/function_x.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1568428029, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/FunctionType/Any/.cflintrc: -------------------------------------------------------------------------------- 1 | { 2 | "rule" : [ ], 3 | "excludes" : [ ], 4 | "includes" : [ { 5 | "code" : "FUNCTION_TYPE_ANY", 6 | "messageText" : null, 7 | "severity" : null 8 | } ], 9 | "inheritParent" : false 10 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/FunctionType/Any/functionany1.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | 3 | public any function x(){ 4 | x=123; 5 | } 6 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/FunctionType/Any/functionmissing1.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | 3 | public function x(){ 4 | x=123; 5 | } 6 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/FunctionType/Any/functionmissing1.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095023, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/FunctionType/Missing/.cflintrc: -------------------------------------------------------------------------------- 1 | { 2 | "includes" : [ { 3 | "code" : "FUNCTION_TYPE_MISSING" 4 | } ], 5 | "inheritParent" : false 6 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/FunctionType/Missing/component_500.cfc: -------------------------------------------------------------------------------- 1 | component{ 2 | 3 | public path.to.Component function cflintTest(){ 4 | return new path.to.Component(); 5 | } 6 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/FunctionType/Missing/component_500.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095023, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/GlobalVarChecker/.cflintrc: -------------------------------------------------------------------------------- 1 | { 2 | "rule" : [ ], 3 | "excludes" : [ ], 4 | "includes" : [ { 5 | "code" : "GLOBAL_VAR", 6 | "messageText" : null, 7 | "severity" : null 8 | } ], 9 | "inheritParent" : false 10 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/GlobalVarChecker/cfcatch_tag.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/GlobalVarChecker/cfcatch_tag.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095023, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Hints/.cflintrc: -------------------------------------------------------------------------------- 1 | { 2 | "rule" : [ ], 3 | "excludes" : [ ], 4 | "includes" : [ { 5 | "code" : "COMPONENT_HINT_MISSING", 6 | "messageText" : null, 7 | "severity" : null 8 | }, { 9 | "code" : "FUNCTION_HINT_MISSING", 10 | "messageText" : null, 11 | "severity" : null 12 | }, { 13 | "code" : "ARG_HINT_MISSING", 14 | "messageText" : null, 15 | "severity" : null 16 | } ], 17 | "inheritParent" : false 18 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Hints/arg_hints_missing.cfc: -------------------------------------------------------------------------------- 1 | /* 2 | @hint This is an annotation hint 3 | */ 4 | component { 5 | 6 | /* 7 | @hint This is an annotation hint 8 | */ 9 | public void function function1() { 10 | someVar = ''; 11 | } 12 | 13 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Hints/arg_hints_missing.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095024, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Hints/hints1.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | 3 | public void function function1(arg1, arg2) hint="test hint attribute"{ 4 | someVar = ''; 5 | } 6 | 7 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Hints/hints2_hintattribute.cfc: -------------------------------------------------------------------------------- 1 | component 2 | hint="test hint attribute" 3 | { 4 | 5 | public void function function1() hint="test hint attribute"{ 6 | someVar = ''; 7 | } 8 | 9 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Hints/hints2_hintattribute.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095024, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Hints/hints3_hintannotation.cfc: -------------------------------------------------------------------------------- 1 | /* 2 | @hint This is an annotation hint 3 | */ 4 | component { 5 | 6 | /* 7 | @hint This is an annotation hint 8 | */ 9 | public void function function1() { 10 | someVar = ''; 11 | } 12 | 13 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Hints/hints3_hintannotation.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095024, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Hints/hints4_emptycomment.cfc: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | */ 4 | component { 5 | 6 | /* 7 | 8 | */ 9 | public void function function1() { 10 | someVar = ''; 11 | } 12 | 13 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Hints/hints5_comment.cfc: -------------------------------------------------------------------------------- 1 | /* 2 | This is a hint 3 | */ 4 | component { 5 | 6 | /* 7 | @hint This is a hint 8 | @arg1 This is arg1 hint 9 | */ 10 | public void function function1(arg1,arg2) { 11 | someVar = ''; 12 | } 13 | 14 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Hints/hints5_comment.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095024, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Ignores/.cflintrc: -------------------------------------------------------------------------------- 1 | { 2 | "rule" : [ ], 3 | "excludes" : [ ], 4 | "includes" : [ { 5 | "code" : "MISSING_VAR", 6 | "messageText" : null, 7 | "severity" : null 8 | }, { 9 | "code" : "CFQUERYPARAM_REQ", 10 | "messageText" : null, 11 | "severity" : null 12 | }], 13 | "inheritParent" : false 14 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Ignores/args/.cflintrc: -------------------------------------------------------------------------------- 1 | { 2 | "rule" : [ ], 3 | "excludes" : [ ], 4 | "includes" : [ { 5 | "code" : "ARG_TYPE_MISSING" 6 | }, { 7 | "code" : "ARG_DEFAULT_MISSING" 8 | }], 9 | "inheritParent" : false 10 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Ignores/args/test_497.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * @hint test component 3 | */ 4 | component { 5 | 6 | /** 7 | * @hint demo function validate 8 | */ 9 | public struct function validate( foo ) { //cflint ignore:ARG_TYPE_MISSING,ARG_DEFAULT_MISSING 10 | // validation logic 11 | 12 | if( isNull( arguments.foo ) ) { 13 | arguments.foo = ''; 14 | } 15 | 16 | return { 17 | 'foo' : arguments.foo, 18 | }; 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Ignores/args/test_497.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095024, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Ignores/ignoreCFMLAny1.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | someVar = ''; 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Ignores/ignoreCFMLAny1.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095024, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Ignores/ignoreCFMLAny2.cfc: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 10 | 11 | var test = ''; 12 | 13 | 14 | someVar = ''; 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Ignores/ignoreCFMLAny2.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095024, 4 | "issues" : [ { 5 | "severity" : "ERROR", 6 | "id" : "MISSING_VAR", 7 | "message" : "MISSING_VAR", 8 | "category" : "CFLINT", 9 | "abbrev" : "MV", 10 | "locations" : [ { 11 | "file" : "src\\test\\resources\\com\\cflint\\tests\\Ignores\\ignoreCFMLAny2.cfc", 12 | "fileName" : "ignoreCFMLAny2.cfc", 13 | "function" : "testFunction", 14 | "offset" : 334, 15 | "column" : 6, 16 | "line" : 14, 17 | "message" : "Variable someVar is not declared with a var statement.", 18 | "variable" : "someVar", 19 | "expression" : "someVar" 20 | } ] 21 | } ], 22 | "counts" : { 23 | "totalFiles" : 0, 24 | "totalLines" : 0, 25 | "countByCode" : [ { 26 | "code" : "MISSING_VAR", 27 | "count" : 1 28 | } ], 29 | "countBySeverity" : [ { 30 | "severity" : "ERROR", 31 | "count" : 1 32 | } ] 33 | } 34 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Ignores/ignoreCFMLAny3_Nested.cfc: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 10 |
11 | 12 | 13 | someVar = ''; 14 | 15 | 16 |
17 |
18 | 19 |
-------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Ignores/ignoreCFMLAny3_Nested.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095025, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Ignores/ignoreCFMLAny4.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095025, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Ignores/ignoreCFMLAny5.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | SELECT 8 | siteID 9 | FROM 10 | somthing WITH (NOLOCK) 11 | WHERE 12 | isLive = 1 13 | 14 | 15 | 16 | 17 | 18 | 19 | variables.siteDetailList[siteID] = {"siteName"="hello"}; // cflint ignore:MISSING_VAR 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Ignores/ignoreCFMLAny5.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095025, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Ignores/ignoreCFMLComponent.cfc: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | someVar = ''; 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Ignores/ignoreCFMLComponent.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095025, 4 | "issues" : [ { 5 | "severity" : "ERROR", 6 | "id" : "MISSING_VAR", 7 | "message" : "MISSING_VAR", 8 | "category" : "CFLINT", 9 | "abbrev" : "MV", 10 | "locations" : [ { 11 | "file" : "src\\test\\resources\\com\\cflint\\tests\\Ignores\\ignoreCFMLComponent.cfc", 12 | "fileName" : "ignoreCFMLComponent.cfc", 13 | "function" : "testFunction", 14 | "offset" : 163, 15 | "column" : 6, 16 | "line" : 8, 17 | "message" : "Variable someVar is not declared with a var statement.", 18 | "variable" : "someVar", 19 | "expression" : "someVar" 20 | } ] 21 | } ], 22 | "counts" : { 23 | "totalFiles" : 0, 24 | "totalLines" : 0, 25 | "countByCode" : [ { 26 | "code" : "MISSING_VAR", 27 | "count" : 1 28 | } ], 29 | "countBySeverity" : [ { 30 | "severity" : "ERROR", 31 | "count" : 1 32 | } ] 33 | } 34 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Ignores/ignoreCFMLComponent2.cfc: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | someVar = ''; 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Ignores/ignoreCFMLComponent2.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095025, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Ignores/ignoreCFMLFunction.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | someVar = ''; 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Ignores/ignoreCFMLFunction.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095025, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Ignores/ignoreLine1.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | 3 | public void function function1() { 4 | someVar = ''; // cflint ignore:line 5 | } 6 | 7 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Ignores/ignoreLine1.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095025, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Ignores/ignoreLineMessage1.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | 3 | public void function function1() { 4 | someVar = ''; // cflint ignore:OTHERCODE,MISSING_VAR,OTHERCODE2 5 | } 6 | 7 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Ignores/ignoreLineMessage1.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095025, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Ignores/ignoreLineMessageUnmatched.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | 3 | public void function function1() { 4 | someVar = ''; // cflint ignore:OTHERCODE,OTHERCODE2 5 | } 6 | 7 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Ignores/ignoreLineMessageUnmatched.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095026, 4 | "issues" : [ { 5 | "severity" : "ERROR", 6 | "id" : "MISSING_VAR", 7 | "message" : "MISSING_VAR", 8 | "category" : "CFLINT", 9 | "abbrev" : "MV", 10 | "locations" : [ { 11 | "file" : "src\\test\\resources\\com\\cflint\\tests\\Ignores\\ignoreLineMessageUnmatched.cfc", 12 | "fileName" : "ignoreLineMessageUnmatched.cfc", 13 | "function" : "function1", 14 | "offset" : 54, 15 | "column" : 6, 16 | "line" : 4, 17 | "message" : "Variable someVar is not declared with a var statement.", 18 | "variable" : "someVar", 19 | "expression" : "someVar" 20 | } ] 21 | } ], 22 | "counts" : { 23 | "totalFiles" : 0, 24 | "totalLines" : 0, 25 | "countByCode" : [ { 26 | "code" : "MISSING_VAR", 27 | "count" : 1 28 | } ], 29 | "countBySeverity" : [ { 30 | "severity" : "ERROR", 31 | "count" : 1 32 | } ] 33 | } 34 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Ignores/ignoreMultiLine.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | 3 | /* 4 | Test! 5 | */ 6 | public void function function1() { 7 | someVar = ''; 8 | } 9 | 10 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Ignores/ignoreMultiLine.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095026, 4 | "issues" : [ { 5 | "severity" : "ERROR", 6 | "id" : "MISSING_VAR", 7 | "message" : "MISSING_VAR", 8 | "category" : "CFLINT", 9 | "abbrev" : "MV", 10 | "locations" : [ { 11 | "file" : "src\\test\\resources\\com\\cflint\\tests\\Ignores\\ignoreMultiLine.cfc", 12 | "fileName" : "ignoreMultiLine.cfc", 13 | "function" : "function1", 14 | "offset" : 71, 15 | "column" : 6, 16 | "line" : 7, 17 | "message" : "Variable someVar is not declared with a var statement.", 18 | "variable" : "someVar", 19 | "expression" : "someVar" 20 | } ] 21 | } ], 22 | "counts" : { 23 | "totalFiles" : 0, 24 | "totalLines" : 0, 25 | "countByCode" : [ { 26 | "code" : "MISSING_VAR", 27 | "count" : 1 28 | } ], 29 | "countBySeverity" : [ { 30 | "severity" : "ERROR", 31 | "count" : 1 32 | } ] 33 | } 34 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Ignores/ignoreMultiLine2.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | 3 | /* 4 | Test! 5 | @CFLintIgnore SOMETHINGELSE,MISSING_VAR,ANOTHERTHINGTOIGNORE 6 | */ 7 | public void function function1() { 8 | someVar = ''; 9 | } 10 | 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Ignores/ignoreMultiLine2.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095026, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Ignores/ignoreMultiLineComponent.cfc: -------------------------------------------------------------------------------- 1 | /* 2 | Test! 3 | */ 4 | component { 5 | 6 | public void function function1() { 7 | someVar = ''; 8 | } 9 | 10 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Ignores/ignoreMultiLineComponent.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095026, 4 | "issues" : [ { 5 | "severity" : "ERROR", 6 | "id" : "MISSING_VAR", 7 | "message" : "MISSING_VAR", 8 | "category" : "CFLINT", 9 | "abbrev" : "MV", 10 | "locations" : [ { 11 | "file" : "src\\test\\resources\\com\\cflint\\tests\\Ignores\\ignoreMultiLineComponent.cfc", 12 | "fileName" : "ignoreMultiLineComponent.cfc", 13 | "function" : "function1", 14 | "offset" : 69, 15 | "column" : 6, 16 | "line" : 7, 17 | "message" : "Variable someVar is not declared with a var statement.", 18 | "variable" : "someVar", 19 | "expression" : "someVar" 20 | } ] 21 | } ], 22 | "counts" : { 23 | "totalFiles" : 0, 24 | "totalLines" : 0, 25 | "countByCode" : [ { 26 | "code" : "MISSING_VAR", 27 | "count" : 1 28 | } ], 29 | "countBySeverity" : [ { 30 | "severity" : "ERROR", 31 | "count" : 1 32 | } ] 33 | } 34 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Ignores/ignoreMultiLineComponent2.cfc: -------------------------------------------------------------------------------- 1 | /* 2 | Test! 3 | @CFLintIgnore SOMETHINGELSE,MISSING_VAR,ANOTHERTHINGTOIGNORE 4 | */ 5 | component { 6 | 7 | public void function function1() { 8 | someVar = ''; 9 | } 10 | 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Ignores/ignoreMultiLineComponent2.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095026, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Ignores/ignore_467.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Ignores/ignore_467.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095026, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Ignores/ignore_489.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | my = structnew(); // cflint ignore:MISSING_VAR 5 | my.somekey = ""; 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Ignores/ignore_489.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095026, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Includes/.cflintrc: -------------------------------------------------------------------------------- 1 | { 2 | "includes" : [ {"code" : "GLOBAL_LITERAL_VALUE_USED_TOO_OFTEN"} 3 | ], 4 | "inheritParent" : false 5 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Includes/Header.cfm: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Includes/Template.cfm: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/LiteralChecker/.cflintrc: -------------------------------------------------------------------------------- 1 | { 2 | "includes" : [ 3 | {"code" : "LOCAL_LITERAL_VALUE_USED_TOO_OFTEN"} 4 | ,{"code" : "GLOBAL_LITERAL_VALUE_USED_TOO_OFTEN"} 5 | ], 6 | "inheritParent" : false 7 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/LiteralChecker/literal_arraysort.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | function foo() { 3 | arraySort(bar, "numeric", 'ASC'); 4 | arraySort(bar, "numeric", 'ASC'); 5 | arraySort(bar, "numeric", 'ASC'); 6 | arraySort(bar, "numeric", 'ASC'); 7 | arraySort(bar, "numeric", 'ASC'); 8 | arraySort(bar, "numeric", 'ASC'); 9 | } 10 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/LiteralChecker/literal_arraysort.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095027, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/LiteralChecker/literal_checker_326.cfm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | Test 10 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/MethodNameChecker/.cflintrc: -------------------------------------------------------------------------------- 1 | { 2 | "rule" : [ ], 3 | "excludes" : [ ], 4 | "includes" : [ { 5 | "code" : "METHOD_TOO_LONG" 6 | } ], 7 | "inheritParent" : false 8 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/MissingDeclaration/.cflintrc: -------------------------------------------------------------------------------- 1 | { 2 | "rule" : [ ], 3 | "excludes" : [ ], 4 | "includes" : [ { 5 | "code" : "MISSING_DECLARATION" 6 | } ], 7 | "inheritParent" : false 8 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/MissingDeclaration/array_used.cfc: -------------------------------------------------------------------------------- 1 | component{ 2 | function foo(){ 3 | addressComponents.streetName = "Main"; 4 | } 5 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/MissingDeclaration/array_used.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095027, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/MissingDeclaration/collect_used.cfc: -------------------------------------------------------------------------------- 1 | component{ 2 | function foo(){ 3 | sampleCollection[7] = "Hello, World"; 4 | } 5 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/MissingDeclaration/collect_used.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095027, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/MissingSemiColon/.cflintrc: -------------------------------------------------------------------------------- 1 | { 2 | "rule" : [ ], 3 | "excludes" : [ ], 4 | "includes" : [ { 5 | "code" : "MISSING_SEMI" 6 | } ], 7 | "inheritParent" : false 8 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/MissingSemiColon/missingSemis1.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | function test() { 3 | name_1 4 | name2 = "Smith" 5 | last.name1 = "Fred" 6 | } 7 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/MissingSemiColon/missingSemis1.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095027, 4 | "issues" : [ { 5 | "severity" : "ERROR", 6 | "id" : "MISSING_SEMI", 7 | "message" : "MISSING_SEMI", 8 | "category" : "CFLINT", 9 | "abbrev" : "MS", 10 | "locations" : [ { 11 | "file" : "src\\test\\resources\\com\\cflint\\tests\\MissingSemiColon\\missingSemis1.cfc", 12 | "fileName" : "missingSemis1.cfc", 13 | "function" : "", 14 | "offset" : 37, 15 | "column" : 6, 16 | "line" : 3, 17 | "message" : "End of statement(;) expected after name_1", 18 | "variable" : "name_1", 19 | "expression" : "" 20 | } ] 21 | } ], 22 | "counts" : { 23 | "totalFiles" : 0, 24 | "totalLines" : 0, 25 | "countByCode" : [ { 26 | "code" : "MISSING_SEMI", 27 | "count" : 1 28 | } ], 29 | "countBySeverity" : [ { 30 | "severity" : "ERROR", 31 | "count" : 1 32 | } ] 33 | } 34 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Naming/.cflintrc: -------------------------------------------------------------------------------- 1 | { 2 | "includes" : [ 3 | {"code" : "VAR_INVALID_NAME"}, 4 | {"code" : "VAR_ALLCAPS_NAME"}, 5 | {"code" : "SCOPE_ALLCAPS_NAME"}, 6 | {"code" : "METHOD_ALLCAPS_NAME"}, 7 | {"code" : "VAR_TOO_SHORT"}, 8 | {"code" : "VAR_TOO_LONG"}, 9 | {"code" : "VAR_TOO_WORDY"}, 10 | {"code" : "VAR_IS_TEMPORARY"}, 11 | {"code" : "VAR_HAS_PREFIX_OR_POSTFIX"} 12 | ], 13 | "inheritParent" : false 14 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Naming/Inconsistent_544.cfc: -------------------------------------------------------------------------------- 1 | component{ 2 | public string function ANOTHERMETHOD(){ 3 | var FO = "Bar"; 4 | local.TEST = "Foo"; 5 | LOCAL.test = "FooBar"; 6 | return LOCAL.FO; 7 | } 8 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Naming/Inconsistent_545_cfml.cfm: -------------------------------------------------------------------------------- 1 | 2 | public string function ANOTHERMETHOD(){ 3 | var FO = "Bar"; 4 | local.TEST = "Foo"; 5 | LOCAL.test = "FooBar"; 6 | return LOCAL.FO; 7 | } 8 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Naming/NewComponent_472.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | function test() { 3 | var theQuery= new Query(); 4 | var thePdf= new Pdf(); 5 | } 6 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Naming/NewComponent_472.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095027, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Naming/nameEndsInNumberScript.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | function test() { 3 | name_1 = "Fred"; 4 | name2 = "Smith"; 5 | last.name1 = "Fred"; 6 | } 7 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Naming/nameEndsInNumberScript.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095027, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Naming/tempVar.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | function foo() { 3 | var tempStruct = {}; 4 | doSomething(tempStruct); 5 | tempStruct.foo = "bar"; 6 | } 7 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Naming/tempVar.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095027, 4 | "issues" : [ { 5 | "severity" : "INFO", 6 | "id" : "VAR_IS_TEMPORARY", 7 | "message" : "VAR_IS_TEMPORARY", 8 | "category" : "CFLINT", 9 | "abbrev" : "VI", 10 | "locations" : [ { 11 | "file" : "src\\test\\resources\\com\\cflint\\tests\\Naming\\tempVar.cfc", 12 | "fileName" : "tempVar.cfc", 13 | "function" : "foo", 14 | "offset" : 45, 15 | "column" : 12, 16 | "line" : 3, 17 | "message" : "Temporary variable tempStruct could be named better.", 18 | "variable" : "tempStruct", 19 | "expression" : "var tempStruct = {}" 20 | } ] 21 | } ], 22 | "counts" : { 23 | "totalFiles" : 0, 24 | "totalLines" : 0, 25 | "countByCode" : [ { 26 | "code" : "VAR_IS_TEMPORARY", 27 | "count" : 1 28 | } ], 29 | "countBySeverity" : [ { 30 | "severity" : "INFO", 31 | "count" : 1 32 | } ] 33 | } 34 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/PackageCase/.cflintrc: -------------------------------------------------------------------------------- 1 | { 2 | "includes" : [ { 3 | "code" : "PACKAGE_CASE_MISMATCH", 4 | "messageText" : null, 5 | "severity" : null 6 | } ], 7 | "inheritParent" : false 8 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/PackageCase/packagecase_nok.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/PackageCase/packagecase_nok.cfc.2: -------------------------------------------------------------------------------- 1 | 2 | new tests.packagecase.packagecase_nok(); 3 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/PackageCase/packagecase_nokC.cfc: -------------------------------------------------------------------------------- 1 | 2 | new tests.packagecase.packagecase_nokC(); 3 | 4 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/PackageCase/packagecase_nokC.cfc.2: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/PackageCase/packagecase_nok_b.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CreateObject("component", "tests.packagecase.packagecase_nok_b"); 5 | 6 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/PackageCase/packagecase_ok.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/PackageCase/packagecase_ok.cfc.2: -------------------------------------------------------------------------------- 1 | 2 | new tests.PackageCase.packagecase_ok(); 3 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/PackageCase/packagecase_ok.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095028, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/ParseError/.cflintrc: -------------------------------------------------------------------------------- 1 | { 2 | "rule" : [ ], 3 | "excludes" : [ ], 4 | "includes" : [ { 5 | "code" : "PARSE_ERROR" 6 | } ], 7 | "inheritParent" : false 8 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/ParseError/attr_space_536.cfm: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/ParseError/attr_space_536.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1527908260, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/ParseError/case_623.cfm: -------------------------------------------------------------------------------- 1 | 2 | function doSomething(id){ 3 | switch (id){ 4 | case -1: 5 | return "new"; 6 | default: 7 | return "existing"; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/ParseError/case_623.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1574137774, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/ParseError/cfloop_359.cfm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/ParseError/cfloop_359.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095029, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/ParseError/fileoutput_359.cfm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/ParseError/fileoutput_359.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095029, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/ParseError/keys_599.cfm: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/ParseError/keys_599.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1568171471, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/ParseError/nestedcomments_629.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 5---> 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/ParseError/nestedcomments_629.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1568514093, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/ParseError/npe_595.cfm: -------------------------------------------------------------------------------- 1 | 2 | function bar(text) { 3 | var foo; 4 | } 5 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/ParseError/npe_595.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1568171026, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/ParseError/ordered_Struct_534.cfm: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/ParseError/ordered_Struct_534.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1568690514, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/ParseError/outside_output_359.cfm: -------------------------------------------------------------------------------- 1 |
#foo#
-------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/ParseError/outside_output_359.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095029, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/ParseError/queryparam_569.cfc: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/ParseError/queryparam_569.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1568695657, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/ParseError/singlequote_359.cfm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/ParseError/singlequote_359.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095029, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Parsing/.cflintrc: -------------------------------------------------------------------------------- 1 | { 2 | "rule" : [ ], 3 | "excludes" : [ ], 4 | "includes" : [ { 5 | "code" : "MISSING_VAR" 6 | }, 7 | { "code" : "PARSE_ERROR"} ], 8 | "inheritParent" : false 9 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Parsing/Underscore.cfc: -------------------------------------------------------------------------------- 1 | 2 | _ = new Underscore(); 3 | //If you can pronounce this you are Teh Uber Nerd 4 | slowX = _.memoize(function(n) { sleep(400*n); return n; }); 5 | thisTime = getTickCount(); 6 | slowX(4); 7 | anotherTime = getTickCount(); 8 | slowX(4); 9 | finalTime = getTickCount(); 10 | writeOutput("Time diff after first call: #anotherTime-thisTime#, diff after second call: #finalTime-anotherTime#"); 11 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Parsing/Underscore.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095030, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Parsing/columns/.cflintrc: -------------------------------------------------------------------------------- 1 | { 2 | "rule" : [ ], 3 | "excludes" : [ ], 4 | "includes" : [ { 5 | "code" : "ARGUMENT_HAS_PREFIX_OR_POSTFIX" 6 | }, 7 | { "code" : "ARGUMENT_IS_TEMPORARY"} , 8 | { "code" : "COMPONENT_INVALID_NAME"} ], 9 | "inheritParent" : false 10 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Parsing/columns/test.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Test hint 3 | */ 4 | component { 5 | /** 6 | * Converts date to formatted string-representation of date 7 | * @dateObj The date object to format 8 | */ 9 | public string function formatDate( 10 | required date dateObj 11 | ) 12 | { 13 | return dateFormat(arguments.dateObj, "mm/dd/yyyy"); 14 | } 15 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Parsing/customerror_647.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | try { 3 | } catch (org.example.whateverError) { 4 | } 5 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Parsing/customerror_647.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1574138302, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Parsing/encodeing_580.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | pageencoding "UTF-8"; 3 | //... 4 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Parsing/encodeing_580.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1568215109, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Parsing/import_359.cfc: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Parsing/import_359.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095030, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Parsing/include_506.cfm: -------------------------------------------------------------------------------- 1 | 2 | string function getTemplatetoInclude(){ 3 | return "foo.cfm"; 4 | } 5 | 6 | // passes cflint 7 | include "#getTemplatetoInclude()#"; 8 | 9 | // fails with java exception 10 | include getTemplatetoInclude(); 11 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Parsing/include_506.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095030, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Parsing/include_96.cfc: -------------------------------------------------------------------------------- 1 | component{ 2 | public void function onRequest(required string targetPage) { 3 | include arguments.targetPage; 4 | return; 5 | } 6 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Parsing/include_96.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095030, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Parsing/inlinearray_650.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | if (!['all'].foo()) { 3 | } 4 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Parsing/inlinearray_650.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1574137773, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Parsing/interface.cfc: -------------------------------------------------------------------------------- 1 | interface { 2 | /** 3 | * component 4 | */ 5 | any function foo(required any bar); 6 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Parsing/interface.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095030, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Parsing/npe_408.cfc: -------------------------------------------------------------------------------- 1 | 2 | // Loop over each CSS pair. 3 | for ( 4 | local.PairIterator = local.Pairs.Iterator() ; 5 | local.PairIterator.HasNext() ; 6 | ){ 7 | } 8 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Parsing/npe_408.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095030, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Parsing/parsing251.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | function foo() { 3 | return bar 4 | } 5 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Parsing/parsing251.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095030, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Parsing/parsing253.cfm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | removeTagList = '|||||,|'; 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Parsing/parsing253.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095030, 4 | "issues" : [ { 5 | "severity" : "ERROR", 6 | "id" : "MISSING_VAR", 7 | "message" : "MISSING_VAR", 8 | "category" : "CFLINT", 9 | "abbrev" : "MV", 10 | "locations" : [ { 11 | "file" : "src\\test\\resources\\com\\cflint\\tests\\Parsing\\parsing253.cfm", 12 | "fileName" : "parsing253.cfm", 13 | "function" : "foo", 14 | "offset" : 61, 15 | "column" : 7, 16 | "line" : 4, 17 | "message" : "Variable removeTagList is not declared with a var statement.", 18 | "variable" : "removeTagList", 19 | "expression" : "removeTagList" 20 | } ] 21 | } ], 22 | "counts" : { 23 | "totalFiles" : 0, 24 | "totalLines" : 0, 25 | "countByCode" : [ { 26 | "code" : "MISSING_VAR", 27 | "count" : 1 28 | } ], 29 | "countBySeverity" : [ { 30 | "severity" : "ERROR", 31 | "count" : 1 32 | } ] 33 | } 34 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Parsing/parsing_346.cfc: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Parsing/parsing_346.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095030, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Query/.cflintrc: -------------------------------------------------------------------------------- 1 | { 2 | "rule" : [ ], 3 | "excludes" : [ ], 4 | "includes" : [ { 5 | "code" : "MISSING_VAR" 6 | }, { 7 | "code" : "QUERYPARAM_REQ" 8 | }, { 9 | "code" : "CFQUERYPARAM_REQ" 10 | }], 11 | "inheritParent" : false 12 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Query/cfquery_param.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | SELECT 5 | fooCol1, siteID, fooCol3 6 | FROM 7 | FooTable 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Query/cfquery_param.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095031, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Query/cfquery_param2.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | SELECT 5 | fooCol1, siteID, fooCol3 6 | FROM 7 | FooTable 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Query/cfquery_param2.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095031, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Query/cfquery_param3.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | SELECT top #arguments.count# 5 | fooCol1, siteID, fooCol3 6 | FROM 7 | FooTable 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Query/cfquery_param_571_a.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | SELECT * 5 | FROM Table 6 | WHERE column = '#foo#' 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Query/cfquery_param_571_b.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | SELECT * 5 | FROM Table 6 | WHERE column = '##foo##' 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Query/cfquery_param_571_b.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095031, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Query/cfquery_param_571_c.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | SELECT * 5 | FROM Table 6 | WHERE column = '###foo###' 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Query/cfquery_param_571_d.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | SELECT * 5 | FROM Table 6 | WHERE column = '####foo####' 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Query/cfquery_param_571_d.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095031, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Query/cfquery_param_case.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SELECT user 6 | FROM users 7 | where user_id = 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/Query/cfquery_script_param_571_a.cfc: -------------------------------------------------------------------------------- 1 | component{ 2 | function foo(){ 3 | var myQry = new Query(); // new query object 4 | myQry.setSQL("select * from app.books where bookid = #bookid# and id = #id#"); 5 | } 6 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/QueryNewChecker/.cflintrc: -------------------------------------------------------------------------------- 1 | { 2 | "includes" : [ { 3 | "code" : "QUERYNEW_DUPLICATE_COLUMNS" 4 | } ], 5 | "inheritParent" : false 6 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/QueryNewChecker/querynew_549.cfc: -------------------------------------------------------------------------------- 1 | component{ 2 | function foo(){ 3 | var q = QueryNew("x,y,Y,z"); 4 | var q2 = QueryNew("x,y,z"); 5 | } 6 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/StructKeyChecker/.cflintrc: -------------------------------------------------------------------------------- 1 | { 2 | "rule" : [ ], 3 | "excludes" : [ ], 4 | "includes" : [ 5 | {"code" : "UNQUOTED_STRUCT_KEY" } 6 | ,{"code" : "STRUCT_ARRAY_NOTATION" } 7 | ], 8 | "inheritParent" : false 9 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/StructKeyChecker/dotNotation_405.cfc: -------------------------------------------------------------------------------- 1 | // not compliant 2 | component{ 3 | function x(){ 4 | sampleStruct.yetAnotherKey = "yetAnotherValue"; 5 | //repeat 6 | sampleStruct.yetAnotherKey = "yetAnotherValue"; 7 | sampleStruct.foo["abc"] = "yetAnotherValue"; 8 | sampleStruct.foo().xyzzy["abc"] = "yetAnotherValue"; 9 | sampleStruct.foo().bar = "yetAnotherValue"; 10 | sampleStruct.foo() = "yetAnotherValue"; 11 | } 12 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/StructKeyChecker/quotedStructKey2.cfc: -------------------------------------------------------------------------------- 1 | //compliant 2 | component{ 3 | function x(){ 4 | var myStruct = { 5 | "myKey" = "myValue" 6 | }; 7 | } 8 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/StructKeyChecker/quotedStructKey2.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095032, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/StructKeyChecker/top_level_542.cfc: -------------------------------------------------------------------------------- 1 | component{ 2 | variables.CFLINT_VERSION = "1.3.0"; 3 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/StructKeyChecker/top_level_542.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 0, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/StructKeyChecker/unquotedStructKey.cfc: -------------------------------------------------------------------------------- 1 | // not compliant 2 | component{ 3 | function x(){ 4 | var myStruct = { 5 | myKey = "myValue" 6 | }; 7 | } 8 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/StructKeyChecker/unquotedStructKeyNested.cfc: -------------------------------------------------------------------------------- 1 | // not compliant 2 | component{ 3 | function x(){ 4 | var myStruct = { 5 | "myKey" = { 6 | mySubKey = "123" 7 | } 8 | }; 9 | } 10 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/TooManyFunctionsChecker/.cflintrc: -------------------------------------------------------------------------------- 1 | { 2 | "rule" : [ ], 3 | "excludes" : [ ], 4 | "includes" : [ { 5 | "code" : "EXCESSIVE_FUNCTIONS"} 6 | ], 7 | "inheritParent" : false 8 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/TooManyFunctionsChecker/excessive_cfml.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/TooManyFunctionsChecker/excessive_cfml2.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/TooManyFunctionsChecker/excessive_cfml2.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095031, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/TooManyFunctionsChecker/excessive_cfscript.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | public void function functionOne() {} 3 | public void function functionTwo() {} 4 | public void function functionThree() {} 5 | public void function functionFour() {} 6 | public void function functionFive() {} 7 | public void function functionSix() {} 8 | public void function functionSeven() {} 9 | public void function functionEight() {} 10 | public void function functionNine() {} 11 | public void function functionTen() {} 12 | public void function functionEleven() {} 13 | public void function function12() {} 14 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/TooManyFunctionsChecker/excessive_cfscript2.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | public void function functionOne() {} 3 | public void function functionTwo() {} 4 | public void function functionThree() {} 5 | public void function functionFour() {} 6 | public void function functionFive() {} 7 | public void function functionSix() {} 8 | public void function functionSeven() {} 9 | public void function functionEight() {} 10 | public void function functionNine() {} 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/TooManyFunctionsChecker/excessive_cfscript2.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095031, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/UnusedArgument/.cflintrc: -------------------------------------------------------------------------------- 1 | { 2 | "rule" : [ ], 3 | "excludes" : [ ], 4 | "includes" : [ { 5 | "code" : "UNUSED_METHOD_ARGUMENT", 6 | "messageText" : null, 7 | "severity" : null 8 | } ], 9 | "inheritParent" : false 10 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/UnusedArgument/FunctionArg_550.cfc: -------------------------------------------------------------------------------- 1 | component{ 2 | public string function myFunction(function doSomething){ 3 | return doSomething(); 4 | } 5 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/UnusedArgument/FunctionArg_550.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095032, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/UnusedArgument/ReturnArg_573.cfc: -------------------------------------------------------------------------------- 1 | component{ 2 | public string function myFunction(baz,bar){ 3 | return baz+1; 4 | } 5 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/UnusedArgument/ReturnArg_573.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 0, 4 | "issues" : [ { 5 | "severity" : "INFO", 6 | "id" : "UNUSED_METHOD_ARGUMENT", 7 | "message" : "UNUSED_METHOD_ARGUMENT", 8 | "category" : "CFLINT", 9 | "abbrev" : "UM", 10 | "locations" : [ { 11 | "file" : "src/test/resources/com/cflint/tests/UnusedArgument/ReturnArg_573.cfc", 12 | "fileName" : "ReturnArg_573.cfc", 13 | "function" : "myFunction", 14 | "offset" : 49, 15 | "column" : 38, 16 | "line" : 2, 17 | "message" : "Argument bar is not used in function. Consider removing it.", 18 | "variable" : "bar", 19 | "expression" : "" 20 | } ] 21 | } ], 22 | "counts" : { 23 | "totalFiles" : 0, 24 | "totalLines" : 0, 25 | "countByCode" : [ { 26 | "code" : "UNUSED_METHOD_ARGUMENT", 27 | "count" : 1 28 | } ], 29 | "countBySeverity" : [ { 30 | "severity" : "INFO", 31 | "count" : 1 32 | } ] 33 | } 34 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/UnusedArgument/UnusedArg_418.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | select * 7 | from domains 8 | where domain = 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/UnusedArgument/UnusedArg_418.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095033, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/UnusedArgument/UnusedArg_573_b.cfc: -------------------------------------------------------------------------------- 1 | component{ 2 | public boolean function getAPIVersion( 3 | required numeric requestedAPIVersion 4 | ){ 5 | return (variables.availableAPIVersions.find(arguments.requestedAPIVersion) > 0) ? 6 | arguments.requestedAPIVersion : 7 | variables.availableAPIVersions[1]; 8 | } 9 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/UnusedArgument/UnusedArg_573_b.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1539043849, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/UnusedArgument/UnusedArg_593.cfc: -------------------------------------------------------------------------------- 1 | component{ 2 | /** 3 | * Some function hint 4 | * @call The value of call 5 | */ 6 | public void function foo( 7 | required string call 8 | ) 9 | { 10 | var bar = ""; 11 | cfhttp(url="#variables.host#", port="22", method="GET", timeout="30", result="local.httpResponse") { 12 | cfhttpparam(type="url", name="call", value="#arguments.call#"); 13 | cfhttpparam(type="url", name="bar", value="#local.bar#"); 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/UnusedArgument/UnusedArg_593.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095032, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/UnusedArgument/UnusedArgument_152.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | return (len(arguments.name)) ? "Hello #arguments.name#" : "Hello World"; 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/UnusedArgument/UnusedArgument_152.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095032, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/UnusedArgument/UnusedArgument_152b.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | return (len(name)) ? "Hello #arguments.name#" : "Hello World"; 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/UnusedArgument/UnusedArgument_227.cfc: -------------------------------------------------------------------------------- 1 | component{ 2 | 3 | function x(arg1,arg2){ 4 | var foo = arguments.arg1.xyzzy; 5 | foo = arguments.arg2.test; 6 | } 7 | 8 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/UnusedArgument/UnusedArgument_227.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095032, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/UnusedArgument/UnusedArgument_257.cfc: -------------------------------------------------------------------------------- 1 | component{ 2 | function updateBucket( 3 | required struct data, 4 | required string cmc, 5 | required string wca, 6 | required array lookUp 7 | ) 8 | { 9 | data.district[ARGUMENTS.lookUp[idx]] += 1; 10 | data.cmc[cmc][ARGUMENTS.lookUp[idx]] += 1; 11 | data.wca[wca][ARGUMENTS.lookUp[idx]] += 1; 12 | } 13 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/UnusedArgument/UnusedArgument_257.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095032, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/UnusedArgument/UnusedArgument_257b.cfc: -------------------------------------------------------------------------------- 1 | component{ 2 | private Boolean function regexCheck( 3 | required string regex, 4 | required string toCheck 5 | ) 6 | { 7 | var myRet = false; 8 | myRet = (refind(ARGUMENTS.regex, ARGUMENTS.toCheck)) ? True : False; 9 | return myRet; 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/UnusedArgument/UnusedArgument_257b.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095032, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/UnusedArgument/UnusedArgument_Case_234.cfc: -------------------------------------------------------------------------------- 1 | component{ 2 | public struct function onLoad(boolean test = false) output="false" { 3 | switch (true) { 4 | case true: 5 | if (arguments.test) { 6 | } 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/UnusedArgument/UnusedArgument_Case_234.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095033, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/UnusedArgument/UnusedArgument_Case_545.cfc: -------------------------------------------------------------------------------- 1 | component{ 2 | 3 | function x(aRg1,Arg2){ 4 | } 5 | 6 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/UnusedVariable/.cflintrc: -------------------------------------------------------------------------------- 1 | { 2 | "rule" : [ ], 3 | "excludes" : [ ], 4 | "includes" : [ { 5 | "code" : "UNUSED_LOCAL_VARIABLE", 6 | "messageText" : null, 7 | "severity" : null 8 | } ], 9 | "inheritParent" : false 10 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/UnusedVariable/UnusedVar_593.cfc: -------------------------------------------------------------------------------- 1 | component{ 2 | /** 3 | * Some function hint 4 | * @call The value of call 5 | */ 6 | public void function foo( 7 | required string call 8 | ) 9 | { 10 | var bar = ""; 11 | cfhttp(url="#variables.host#", port="22", method="GET", timeout="30", result="local.httpResponse") { 12 | cfhttpparam(type="url", name="call", value="#arguments.call#"); 13 | cfhttpparam(type="url", name="bar", value="#local.bar#"); 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/UnusedVariable/caselessVariable_242.cfc: -------------------------------------------------------------------------------- 1 | component{ 2 | function foo() { 3 | var bar = 1; 4 | return Bar; 5 | } 6 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/UnusedVariable/caselessVariable_242.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095033, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/UnusedVariable/cflog_339.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/UnusedVariable/cflog_339.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095033, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/UnusedVariable/cfloopname_339.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ... 5 | 6 | ... 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/UnusedVariable/cfloopname_339.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095033, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/UnusedVariable/cfoutput_464.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | var resultText=""; 5 | 6 | 7 | 8 | #resultText# 9 | 10 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/UnusedVariable/cfoutput_464.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1568216331, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/UnusedVariable/cfquery_339.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/UnusedVariable/cfquery_339.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095033, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/UnusedVariable/cfqueryname_339.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/UnusedVariable/cfqueryname_339.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095033, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/UnusedVariable/cookie_339.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/UnusedVariable/cookie_339.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095033, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/UnusedVariable/forLoop_211.cfc: -------------------------------------------------------------------------------- 1 | component{ 2 | 3 | public numeric function save( ) { 4 | 5 | for (var key in values) { 6 | foo[key] = values[key]; 7 | } 8 | return 'x'; 9 | } 10 | 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/UnusedVariable/forLoop_211.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095033, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/UnusedVariable/forLoop_227.cfc: -------------------------------------------------------------------------------- 1 | component{ 2 | 3 | public numeric function save( ) { 4 | 5 | var x = {}; 6 | var a = local.x.foo; 7 | return a.foo; 8 | } 9 | 10 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/UnusedVariable/forLoop_227.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095033, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/UnusedVariable/httpparam_593.cfc: -------------------------------------------------------------------------------- 1 | component{ 2 | public void function foo( 3 | required string call 4 | ) 5 | { 6 | var bar = ""; 7 | cfhttp(url="#variables.host#", port="22", method="GET", timeout="30", result="local.httpResponse") { 8 | cfhttpparam(type="url", name="call", value="#arguments.call#"); 9 | cfhttpparam(type="url", name="bar", value="#local.bar#"); 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/UnusedVariable/httpparam_593.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 0, 4 | "issues" : [ { 5 | "severity" : "INFO", 6 | "id" : "UNUSED_LOCAL_VARIABLE", 7 | "message" : "UNUSED_LOCAL_VARIABLE", 8 | "category" : "CFLINT", 9 | "abbrev" : "UL", 10 | "locations" : [ { 11 | "file" : "src/test/resources/com/cflint/tests/UnusedVariable/httpparam_593.cfc", 12 | "fileName" : "httpparam_593.cfc", 13 | "function" : "foo", 14 | "offset" : 6, 15 | "column" : 7, 16 | "line" : 1, 17 | "message" : "Local variable httpResponse is not used in function foo. Consider removing it.", 18 | "variable" : "httpResponse", 19 | "expression" : "httpResponse" 20 | } ] 21 | } ], 22 | "counts" : { 23 | "totalFiles" : 0, 24 | "totalLines" : 0, 25 | "countByCode" : [ { 26 | "code" : "UNUSED_LOCAL_VARIABLE", 27 | "count" : 1 28 | } ], 29 | "countBySeverity" : [ { 30 | "severity" : "INFO", 31 | "count" : 1 32 | } ] 33 | } 34 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/UnusedVariable/local_339.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | foo(local.stEditor) 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/UnusedVariable/local_339.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095034, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/UnusedVariable/local_leftuse_592.cfc: -------------------------------------------------------------------------------- 1 | component{ 2 | function safetext(text) { 3 | local.foo = {}; 4 | local.foo2 = '1'; 5 | foo[foo2]=1; 6 | baz(foo); 7 | } 8 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/UnusedVariable/local_leftuse_592.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1539040698, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/UnusedVariable/local_nested_592.cfc: -------------------------------------------------------------------------------- 1 | component{ 2 | function safetext(text) { 3 | local.foo = {}; 4 | local.foo2 = '1'; 5 | baz(foo[foo2]); 6 | } 7 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/UnusedVariable/local_nested_592.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1539040669, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/UnusedVariable/local_simple_592.cfc: -------------------------------------------------------------------------------- 1 | component{ 2 | function bar(text) { 3 | local.foo=""; 4 | local.foo2 = ""; 5 | local.foo3 = foo2; 6 | } 7 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/UnusedVariable/local_simple_cfml_593.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | local.foo=""; 5 | local.foo2 = ""; 6 | local.foo3 = foo2; 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/UnusedVariable/location_339.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/UnusedVariable/location_339.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095034, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/UnusedVariable/loop_631.cfc: -------------------------------------------------------------------------------- 1 | component{ 2 | function foo(){ 3 | var thisBase = getRowBaseFromMap(baseDataMap, row); 4 | for( var v in baseVars ){ 5 | ar.Append(thisBase.KeyExists(v.shortname) ? thisBase[v.shortname] : ''); 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/UnusedVariable/loop_631.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 0, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/UnusedVariable/loop_list_339.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/UnusedVariable/loop_list_339.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095034, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/UnusedVariable/newobj_640.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Some function hint 3 | */ 4 | public User function createUser() 5 | { 6 | var userName = "KamasamaK"; 7 | var user = new User(userName); 8 | 9 | return user; 10 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/UnusedVariable/newobj_640.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1574217909, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/UnusedVariable/sampleQuery_577.cfc: -------------------------------------------------------------------------------- 1 | component{ 2 | package query function foo() { 3 | var sampleQuery = queryNew("valid"); 4 | var sampleQueryOfQuery = new Query(SampleQuery="#sampleQuery#"); 5 | sampleQueryOfQuery.setName("sampleQueryOfQuery"); 6 | sampleQueryOfQuery.setDbType("query"); 7 | sampleQueryOfQuery.setSql(" 8 | SELECT * 9 | FROM SampleQuery 10 | WHERE valid = 1 11 | "); 12 | 13 | return sampleQueryOfQuery.execute().getResult(); 14 | } 15 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/UnusedVariable/sampleQuery_577.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1528242485, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/UnusedVariable/simpleUnused.cfc: -------------------------------------------------------------------------------- 1 | component{ 2 | 3 | public numeric function save( ) { 4 | var foo = 123; 5 | } 6 | 7 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/UnusedVariable/simpleUnused.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095034, 4 | "issues" : [ { 5 | "severity" : "INFO", 6 | "id" : "UNUSED_LOCAL_VARIABLE", 7 | "message" : "UNUSED_LOCAL_VARIABLE", 8 | "category" : "CFLINT", 9 | "abbrev" : "UL", 10 | "locations" : [ { 11 | "file" : "src\\test\\resources\\com\\cflint\\tests\\UnusedVariable\\simpleUnused.cfc", 12 | "fileName" : "simpleUnused.cfc", 13 | "function" : "save", 14 | "offset" : 53, 15 | "column" : 5, 16 | "line" : 4, 17 | "message" : "Local variable foo is not used in function save. Consider removing it.", 18 | "variable" : "foo", 19 | "expression" : "" 20 | } ] 21 | } ], 22 | "counts" : { 23 | "totalFiles" : 0, 24 | "totalLines" : 0, 25 | "countByCode" : [ { 26 | "code" : "UNUSED_LOCAL_VARIABLE", 27 | "count" : 1 28 | } ], 29 | "countBySeverity" : [ { 30 | "severity" : "INFO", 31 | "count" : 1 32 | } ] 33 | } 34 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/UnusedVariable/transaction_497.cfc: -------------------------------------------------------------------------------- 1 | component{ 2 | function foo(){ 3 | var foo = ""; 4 | transaction { 5 | foo = 1; 6 | bar(foo); 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/UnusedVariable/transaction_497.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095034, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/UnusedVariable/while_465.cfc: -------------------------------------------------------------------------------- 1 | component{ 2 | function safetext(text) { 3 | var obracket = find("<",theText); 4 | var badTag = ""; 5 | var nextStart = ""; 6 | while(obracket){ 7 | badTag = REFindNoCase(); 8 | if(badTag.pos[1]){ 9 | nextStart = badTag.pos[1] + badTag.len[1]; 10 | } 11 | else{ 12 | nextStart = obracket + 1; 13 | } 14 | } 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/UnusedVariable/while_465.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095034, 4 | "issues" : [ { 5 | "severity" : "INFO", 6 | "id" : "UNUSED_LOCAL_VARIABLE", 7 | "message" : "UNUSED_LOCAL_VARIABLE", 8 | "category" : "CFLINT", 9 | "abbrev" : "UL", 10 | "locations" : [ { 11 | "file" : "src\\test\\resources\\com\\cflint\\tests\\UnusedVariable\\while_465.cfc", 12 | "fileName" : "while_465.cfc", 13 | "function" : "safetext", 14 | "offset" : 112, 15 | "column" : 8, 16 | "line" : 5, 17 | "message" : "Local variable nextStart is not used in function safetext. Consider removing it.", 18 | "variable" : "nextStart", 19 | "expression" : "" 20 | } ] 21 | } ], 22 | "counts" : { 23 | "totalFiles" : 0, 24 | "totalLines" : 0, 25 | "countByCode" : [ { 26 | "code" : "UNUSED_LOCAL_VARIABLE", 27 | "count" : 1 28 | } ], 29 | "countBySeverity" : [ { 30 | "severity" : "INFO", 31 | "count" : 1 32 | } ] 33 | } 34 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VarScoper/.cflintrc: -------------------------------------------------------------------------------- 1 | { 2 | "rule" : [ ], 3 | "excludes" : [ ], 4 | "includes" : [ { 5 | "code" : "MISSING_VAR", 6 | "messageText" : null, 7 | "severity" : null 8 | } ], 9 | "inheritParent" : false 10 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VarScoper/482_cfmail.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | function test () { 3 | cfmail( from="test@test.de", to="test@test.de" subject="#subjectText#" type="html" ){ 4 | } 5 | } 6 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VarScoper/482_cfmail.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095035, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VarScoper/482_mail.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | function test () { 3 | mail from="test@test.de", to="test@test.de" subject="#subjectText#" type="html"{} 4 | } 5 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VarScoper/482_mail.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095035, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VarScoper/553_catch.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | public string function renderPage( required any page, required any docTree, required boolean edit ){ 3 | try { 4 | var renderedPage = renderTemplate( 5 | template = "templates/#_getPageLayoutFile( arguments.page )#.cfm" 6 | , args = { page = arguments.page, docTree=arguments.docTree, edit=edit } 7 | , helpers = "/builders/html/helpers" 8 | ); 9 | } catch( any e ) { 10 | e.additional.luceeDocsPageId = arguments.page.getid(); 11 | rethrow; 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VarScoper/553_catch.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095036, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VarScoper/553_cfml_catch.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VarScoper/553_cfml_catch.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095036, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VarScoper/cfcookie_518.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VarScoper/cfcookie_518.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095036, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VarScoper/cfdocumentsection_462.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VarScoper/cfdocumentsection_462.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095036, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VarScoper/cfloop_index_413.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VarScoper/cfquery_scoper.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | SELECT 5 | fooCol1, siteID, fooCol3 6 | FROM 7 | FooTable 8 | 9 | 10 | 11 | 12 | siteID = 123; 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VarScoper/cfquery_scoper.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095036, 4 | "issues" : [ { 5 | "severity" : "ERROR", 6 | "id" : "MISSING_VAR", 7 | "message" : "MISSING_VAR", 8 | "category" : "CFLINT", 9 | "abbrev" : "MV", 10 | "locations" : [ { 11 | "file" : "src\\test\\resources\\com\\cflint\\tests\\VarScoper\\cfquery_scoper.cfc", 12 | "fileName" : "cfquery_scoper.cfc", 13 | "function" : "foo", 14 | "offset" : 306, 15 | "column" : 3, 16 | "line" : 15, 17 | "message" : "Variable siteID is not declared with a var statement.", 18 | "variable" : "siteID", 19 | "expression" : "siteID" 20 | } ] 21 | } ], 22 | "counts" : { 23 | "totalFiles" : 0, 24 | "totalLines" : 0, 25 | "countByCode" : [ { 26 | "code" : "MISSING_VAR", 27 | "count" : 1 28 | } ], 29 | "countBySeverity" : [ { 30 | "severity" : "ERROR", 31 | "count" : 1 32 | } ] 33 | } 34 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VarScoper/cfqueryparam_569.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | or l1.googleID in () 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VarScoper/cftag_483_1.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | 3 | public tagCFC function init() { 4 | throw message=""; 5 | } 6 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VarScoper/cftag_483_1.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095036, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VarScoper/cftag_483_2.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | 3 | public tagCFC function init() { 4 | cfwddx(action="fml2wddx", input="#attribs#", output="attribsWDDX"); 5 | } 6 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VarScoper/cftag_483_2.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1528666729, 4 | "issues" : [ { 5 | "severity" : "ERROR", 6 | "id" : "MISSING_VAR", 7 | "message" : "MISSING_VAR", 8 | "category" : "CFLINT", 9 | "abbrev" : "MV", 10 | "locations" : [ { 11 | "file" : "src\\test\\resources\\com\\cflint\\tests\\VarScoper\\cftag_483_2.cfc", 12 | "fileName" : "cftag_483_2.cfc", 13 | "function" : "init", 14 | "offset" : 57, 15 | "column" : 9, 16 | "line" : 4, 17 | "message" : "Variable attribsWDDX is not declared with a var statement.", 18 | "variable" : "attribsWDDX", 19 | "expression" : "cfwddx(action = 'fml2wddx', input = '#attribs#', output = 'attribsWDDX')" 20 | } ] 21 | } ], 22 | "counts" : { 23 | "totalFiles" : 0, 24 | "totalLines" : 0, 25 | "countByCode" : [ { 26 | "code" : "MISSING_VAR", 27 | "count" : 1 28 | } ], 29 | "countBySeverity" : [ { 30 | "severity" : "ERROR", 31 | "count" : 1 32 | } ] 33 | } 34 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VarScoper/cftag_483_3.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | 3 | public tagCFC function init() { 4 | cfthrow(message=""); 5 | } 6 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VarScoper/cftag_483_3.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095036, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VarScoper/cftry.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | 3 | public tagCFC function init(required string username, required string password) { 4 | try{ 5 | tryVar = ''; 6 | }catch(any e){ 7 | catchVar = ''; 8 | }finally{ 9 | finallyVar = ''; 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VarScoper/for_each.cfc: -------------------------------------------------------------------------------- 1 | component{ 2 | function ffoo(any XSS){ 3 | For (Fixeld in Arguments.XSS) { 4 | foo(); 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VarScoper/for_each.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095036, 4 | "issues" : [ { 5 | "severity" : "ERROR", 6 | "id" : "MISSING_VAR", 7 | "message" : "MISSING_VAR", 8 | "category" : "CFLINT", 9 | "abbrev" : "MV", 10 | "locations" : [ { 11 | "file" : "src\\test\\resources\\com\\cflint\\tests\\VarScoper\\for_each.cfc", 12 | "fileName" : "for_each.cfc", 13 | "function" : "ffoo", 14 | "offset" : 43, 15 | "column" : 9, 16 | "line" : 3, 17 | "message" : "Variable Fixeld is not declared with a var statement.", 18 | "variable" : "Fixeld", 19 | "expression" : "Fixeld" 20 | } ] 21 | } ], 22 | "counts" : { 23 | "totalFiles" : 0, 24 | "totalLines" : 0, 25 | "countByCode" : [ { 26 | "code" : "MISSING_VAR", 27 | "count" : 1 28 | } ], 29 | "countBySeverity" : [ { 30 | "severity" : "ERROR", 31 | "count" : 1 32 | } ] 33 | } 34 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VarScoper/fpositive/.cflintrc: -------------------------------------------------------------------------------- 1 | { 2 | "rule" : [ ], 3 | "excludes" : [ ], 4 | "includes" : [ { 5 | "code" : "MISSING_VAR", 6 | "messageText" : null, 7 | "severity" : null 8 | } ], 9 | "inheritParent" : false 10 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VarScoper/fpositive/cfthread.cfc: -------------------------------------------------------------------------------- 1 | component{ 2 | function foo(){ 3 | cfthread.myThread1.foo=1; 4 | } 5 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VarScoper/fpositive/cfthread.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 0, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VarScoper/fpositive/constructor.cfc: -------------------------------------------------------------------------------- 1 | component{ 2 | function foo(){ 3 | application.facebookSDK.facebookApp = new facebook.sdk.FacebookApp( 4 | appId=application.config.FBPhotoEndpoint_APPID, 5 | secretKey=application.config.FBPhotoEndpoint_SECRET_KEY, 6 | apiVersion=application.config.FBPhotoEndpoint_Version); 7 | } 8 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VarScoper/fpositive/constructor.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095037, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VarScoper/fpositive/expectation.cfc: -------------------------------------------------------------------------------- 1 | component{ 2 | function foo(){ 3 | var oExpectation = new Expectation( spec=this, assertions=this.$assert, mockbox=this.$mockbox ); 4 | thread.closures = arguments.closures; 5 | } 6 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VarScoper/fpositive/expectation.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095037, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VarScoper/fpositive/http.cfc: -------------------------------------------------------------------------------- 1 | component{ 2 | function foo(resourceUri){ 3 | var httpRequest = new HTTP( 4 | method = "get", 5 | url = ("http://api.foo.com" & resourceUri), 6 | charset = "utf-8" 7 | ); 8 | } 9 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VarScoper/fpositive/http.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095037, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VarScoper/fpositive/http2.cfc: -------------------------------------------------------------------------------- 1 | component{ 2 | function foo(resourceUri){ 3 | var httpRequest = new Http(method=arguments.method, url=variables.ENDPOINT & arguments.resourceUri, charset="utf-8", timeout=arguments.timeout, throwOnError=false, username=variables.something, password=variables.somethingelse, getAsBinary="never"); 4 | } 5 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VarScoper/fpositive/http2.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095037, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VarScoper/fpositive/mail.cfc: -------------------------------------------------------------------------------- 1 | component{ 2 | function foo(mailBody){ 3 | var mailService=new mail( 4 | to="...", 5 | from="...", 6 | subject="...", 7 | type="HTML", 8 | body=mailBody 9 | ); 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VarScoper/fpositive/mail.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095037, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VarScoper/fpositive/query.cfc: -------------------------------------------------------------------------------- 1 | component{ 2 | function foo(){ 3 | var qGetSites = new Query(datasource="...", sql="..."); 4 | } 5 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VarScoper/fpositive/query.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095037, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VarScoper/fpositive/tag.cfc: -------------------------------------------------------------------------------- 1 | component{ 2 | void function setCallerVars(data, row, getRow, columnNames){ 3 | var currentRow=0; 4 | var rowData = getRow(data, row, columnNames); 5 | caller["currentRow"] = currentRow; 6 | } 7 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VarScoper/fpositive/tag.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095037, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VarScoper/local_256.cfc: -------------------------------------------------------------------------------- 1 | component{ 2 | function ffoo(){ 3 | local.foo = 123; 4 | foo = 123; 5 | } 6 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VarScoper/local_256.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095037, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VarScoper/lock_488.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | function test () { 3 | var test = 1; 4 | var r = {}; 5 | lock name="mylock" type="exclusive" timeout="20" throwontimeout=true { 6 | r.test = test; 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VarScoper/lock_488.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095037, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VarScoper/namedArgs.cfc: -------------------------------------------------------------------------------- 1 | component{ 2 | function x(){ 3 | var callRate = getServiceLocator().get("object.cps.CallRate"); 4 | callRate.init(crid = CallRateId, newName = Name, newDescription = Description); 5 | ArrayAppend(result, callRate); 6 | } 7 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VarScoper/namedArgs.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095037, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VarScoper/property_246.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | property name="foo" type="string"; 3 | 4 | public void function bar() { 5 | foo = "baz"; 6 | } 7 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VarScoper/property_246.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095037, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VarScoper/pureScript.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | property string username; 3 | property string password; 4 | 5 | public tagCFC function init(required string username, required string password) { 6 | someVar = ''; 7 | return this; 8 | } 9 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VarScoper/pureScript.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095038, 4 | "issues" : [ { 5 | "severity" : "ERROR", 6 | "id" : "MISSING_VAR", 7 | "message" : "MISSING_VAR", 8 | "category" : "CFLINT", 9 | "abbrev" : "MV", 10 | "locations" : [ { 11 | "file" : "src\\test\\resources\\com\\cflint\\tests\\VarScoper\\pureScript.cfc", 12 | "fileName" : "pureScript.cfc", 13 | "function" : "init", 14 | "offset" : 155, 15 | "column" : 6, 16 | "line" : 6, 17 | "message" : "Variable someVar is not declared with a var statement.", 18 | "variable" : "someVar", 19 | "expression" : "someVar" 20 | } ] 21 | } ], 22 | "counts" : { 23 | "totalFiles" : 0, 24 | "totalLines" : 0, 25 | "countByCode" : [ { 26 | "code" : "MISSING_VAR", 27 | "count" : 1 28 | } ], 29 | "countBySeverity" : [ { 30 | "severity" : "ERROR", 31 | "count" : 1 32 | } ] 33 | } 34 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VarScoper/scopesUse_404.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | local.streetName = streetName; 8 | application.streetNumber = 456; 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VarScoper/scopesUse_404.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095038, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VarScoper/scriptSample186.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | 3 | public void function leakMemory(leak_modifier) { 4 | leaky_variable = leak_modifier; 5 | leakier_variable = leaky_variable * 2; 6 | 7 | return leaky_variable * leakier_variable; 8 | } 9 | 10 | public void function poorlyWrittenFunction() { 11 | writeDump(' 12 | 13 | '); 14 | } 15 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VarScoper/scripttags/.cflintrc: -------------------------------------------------------------------------------- 1 | { 2 | "rule" : [ ], 3 | "excludes" : [ ], 4 | "includes" : [ { 5 | "code" : "MISSING_VAR", 6 | "messageText" : null, 7 | "severity" : null 8 | } ], 9 | "inheritParent" : false 10 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VarScoper/scripttags/cfhttp.cfc: -------------------------------------------------------------------------------- 1 | component{ 2 | /** 3 | * Some function 4 | * @call The value of the call 5 | */ 6 | public void function foo( 7 | required string call 8 | ) 9 | { 10 | cfhttp(url="#variables.host#", port="#variables.port#", method="GET", timeout="30", result="httpResponse") { 11 | cfhttpparam(type="url", name="call", value="#arguments.call#"); 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VarScoper/structUse2_404.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | tokenizedAddress["streetName"] = streetName; 8 | tokenizedAddress2["streetNumber"] = 456; 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VarScoper/structUse_404.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | tokenizedAddress2.streetName = streetName; 8 | tokenizedAddress2.streetNumber = 456; 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VarScoper/structassignment.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | var siteDetail={}; 5 | foobar.foo.xyz.[siteID] = 123; 6 | siteDetail.foo.xyz.[siteID] = 123; 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VarScoper/structassignment.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095038, 4 | "issues" : [ { 5 | "severity" : "ERROR", 6 | "id" : "MISSING_VAR", 7 | "message" : "MISSING_VAR", 8 | "category" : "CFLINT", 9 | "abbrev" : "MV", 10 | "locations" : [ { 11 | "file" : "src\\test\\resources\\com\\cflint\\tests\\VarScoper\\structassignment.cfc", 12 | "fileName" : "structassignment.cfc", 13 | "function" : "foo", 14 | "offset" : 91, 15 | "column" : 11, 16 | "line" : 5, 17 | "message" : "Variable foobar is not declared with a var statement.", 18 | "variable" : "foobar", 19 | "expression" : "foobar.foo.xyz[siteID]" 20 | } ] 21 | } ], 22 | "counts" : { 23 | "totalFiles" : 0, 24 | "totalLines" : 0, 25 | "countByCode" : [ { 26 | "code" : "MISSING_VAR", 27 | "count" : 1 28 | } ], 29 | "countBySeverity" : [ { 30 | "severity" : "ERROR", 31 | "count" : 1 32 | } ] 33 | } 34 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VarScoper/structureKeys_197.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | 3 | public void function function1() { 4 | var testStructure = { 5 | testKey = "testValue" 6 | }; 7 | } 8 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VarScoper/structureKeys_197.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095038, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VarScoper/structure_keys_197.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | 3 | public void function test() { 4 | var params = { 5 | claimId = { value = claimDetail.getID(), cfsqltype = "CF_SQL_INTEGER" }, 6 | serialNo = { value = claimDetail.getSerialNo(), cfsqltype = "CF_SQL_VARCHAR" } 7 | }; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VarScoper/structure_keys_197.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095038, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VarScoper/testParse.cfc: -------------------------------------------------------------------------------- 1 | component hint="testing" accessors = "true" { 2 | 3 | /** 4 | * @hint "This is a test" 5 | * @thing "a hint?"" 6 | */ 7 | public numeric function save( required component thing ) { 8 | 9 | var sql = "INSERT INTO thingTbl( 10 | thingId, 11 | name) VALUES ( 12 | :thingId, 13 | :name"; 14 | 15 | var params = { 16 | thingId = { "value" = thing.getID(), "cfsqltype" = "CF_SQL_INTEGER" }, 17 | name = { "value" = thing.getName(), "cfsqltype" = "CF_SQL_VARCHAR", null = !len( thing.getName() ) } 18 | }; 19 | 20 | QueryExecute( sql, params ); 21 | 22 | return thing.getID(); 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VarScoper/testParse.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095038, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VariableNameChecker/.cflintrc: -------------------------------------------------------------------------------- 1 | { 2 | "rule" : [ ], 3 | "excludes" : [ ], 4 | "includes" : [ { 5 | "code" : "VAR_INVALID_NAME", 6 | "messageText" : null, 7 | "severity" : null 8 | }, { 9 | "code" : "VAR_ALLCAPS_NAME", 10 | "messageText" : null, 11 | "severity" : null 12 | }, { 13 | "code" : "SCOPE_ALLCAPS_NAME", 14 | "messageText" : null, 15 | "severity" : null 16 | }, { 17 | "code" : "VAR_TOO_SHORT", 18 | "messageText" : null, 19 | "severity" : null 20 | }, { 21 | "code" : "VAR_TOO_LONG", 22 | "messageText" : null, 23 | "severity" : null 24 | }, { 25 | "code" : "VAR_TOO_WORDY", 26 | "messageText" : null, 27 | "severity" : null 28 | }, { 29 | "code" : "VAR_IS_TEMPORARY", 30 | "messageText" : null, 31 | "severity" : null 32 | }, { 33 | "code" : "VAR_HAS_PREFIX_OR_POSTFIX", 34 | "messageText" : null, 35 | "severity" : null 36 | } ], 37 | "inheritParent" : false 38 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VariableNameChecker/532_naming.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | 3 | public tagCFC function init() { 4 | 5 | if (urlScope.keyExists('id2') && isNumeric(urlScope.id2)) { 6 | route &= '/:id2'; 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VariableNameChecker/532_naming.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095034, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VariableNameChecker/cftry.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | 3 | public tagCFC function init() { 4 | 5 | var q=123; 6 | if(1 eq 1){ 7 | var z=123; 8 | var asdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjkl=10; 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VariableNameChecker/componentID_499.cfc: -------------------------------------------------------------------------------- 1 | component{ 2 | 3 | function foo(){ 4 | local.fooBar = new path.to.Component(); 5 | } 6 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VariableNameChecker/componentID_499.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095035, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VariableNameChecker/config/length_314.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | 3 | public tagCFC function init() { 4 | 5 | var q12=123; 6 | if(1 eq 1){ 7 | var asdfghjklasdfghj=10; 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VariableNameChecker/config2/.cflintrc: -------------------------------------------------------------------------------- 1 | { 2 | "inheritParent" : true, 3 | "parameters": 4 | { 5 | "VariableNameChecker.minLength": "4", 6 | "VariableNameChecker.maxLength": "15" 7 | } 8 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VariableNameChecker/config2/length_314.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | 3 | public tagCFC function init() { 4 | 5 | var q12=123; 6 | if(1 eq 1){ 7 | var asdfghjklasdfghj=10; 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VariableNameChecker/leaderboard_450.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | private any function call( required string url ){ 3 | var service = new http( 4 | url = arguments.url 5 | , method = "GET" 6 | , charset = "utf-8" 7 | , timeout = variables.config.timeout 8 | , throwonerror = "false" 9 | ); 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VariableNameChecker/leaderboard_450.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095035, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VariableNameChecker/local_537.cfm: -------------------------------------------------------------------------------- 1 | 2 | 4 | // Do stuff 5 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VariableNameChecker/query_naming_blank_601.cfc: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VariableNameChecker/query_naming_blank_601.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1568172244, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VariableNameChecker/query_naming_hash_601.cfc: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VariableNameChecker/sample1_228.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | public string function getStringFromStruct(required struct LocalData, required string keyToCheck) { 3 | if(!isNull(LocalData)) { 4 | if(StructKeyExists(LocalData, keyToCheck)) { 5 | return LocalData[keyToCheck]; 6 | } 7 | } 8 | return ''; 9 | } 10 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VariableNameChecker/sample1_635.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | public string function getStringFromStruct(required struct shelfLevelX,required string keyToCheck) { 3 | if(!isNull(shelfLevelX )) { 4 | if(StructKeyExists(shelfLevelX , keyToCheck)) { 5 | return shelfLevelX [keyToCheck]; 6 | } 7 | } 8 | return ''; 9 | } 10 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VariableNameChecker/sample1_635.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1568428747, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VariableNameChecker/sample_239.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | this.ROOMRESERVATIONS.SINGLE = 1; 3 | this.ROOMRESERVATIONS.DOUBLE = 2; 4 | 5 | this.YES = 1; 6 | this.NO = 2; 7 | 8 | VARIABLE = 10; 9 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VariableNameChecker/sample_239.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095035, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VariableNameChecker/scope_608.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | SELECT * 5 | FROM Transactions 6 | 7 | 8 | SELECT * 9 | FROM Transactions 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VariableNameChecker/task_476.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VariableNameChecker/thisTag_479.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/VariableNameChecker/thisTag_479.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095035, 4 | "issues" : [ ], 5 | "counts" : { 6 | "totalFiles" : 0, 7 | "totalLines" : 0, 8 | "countByCode" : [ ], 9 | "countBySeverity" : [ ] 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/WriteDumpChecker/.cflintrc: -------------------------------------------------------------------------------- 1 | { 2 | "rule" : [ ], 3 | "excludes" : [ ], 4 | "includes" : [ { 5 | "code" : "AVOID_USING_WRITEDUMP", 6 | "messageText" : null, 7 | "severity" : null 8 | } ], 9 | "inheritParent" : false 10 | } -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/WriteDumpChecker/output_hash_625.cfc: -------------------------------------------------------------------------------- 1 | 2 | #writeDump(now(), 'HH:mm:ss')# 3 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/WriteDumpChecker/script_hash_625.cfc: -------------------------------------------------------------------------------- 1 | 2 | #writeDump(now(), 'HH:mm:ss')# 3 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/WriteDumpChecker/writeDump.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | writeDump(name); 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/test/resources/com/cflint/tests/WriteDumpChecker/writeDump.expected.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "", 3 | "timestamp" : 1526095038, 4 | "issues" : [ { 5 | "severity" : "INFO", 6 | "id" : "AVOID_USING_WRITEDUMP", 7 | "message" : "AVOID_USING_WRITEDUMP", 8 | "category" : "CFLINT", 9 | "abbrev" : "AU", 10 | "locations" : [ { 11 | "file" : "src\\test\\resources\\com\\cflint\\tests\\WriteDumpChecker\\writeDump.cfc", 12 | "fileName" : "writeDump.cfc", 13 | "function" : "helloWorld", 14 | "offset" : 231, 15 | "column" : 5, 16 | "line" : 6, 17 | "message" : "Avoid using the writeDump function in production code.", 18 | "variable" : "writeDump", 19 | "expression" : "writeDump(name)" 20 | } ] 21 | } ], 22 | "counts" : { 23 | "totalFiles" : 0, 24 | "totalLines" : 0, 25 | "countByCode" : [ { 26 | "code" : "AVOID_USING_WRITEDUMP", 27 | "count" : 1 28 | } ], 29 | "countBySeverity" : [ { 30 | "severity" : "INFO", 31 | "count" : 1 32 | } ] 33 | } 34 | } --------------------------------------------------------------------------------