From 93fc810d05c269544cb6fa4517cdf7334309fb21 Mon Sep 17 00:00:00 2001 From: KamasamaK Date: Sat, 29 Jul 2017 12:08:04 -0400 Subject: [PATCH 1/4] Added .cflintrc schema and output schemas for JSON and XML. Tweaked README. (#377) Added .cflintrc schema and output schemas for JSON and XML. Tweaked README. --- README.md | 210 +++++++++-------- .../resources/schemas/.cflintrc.schema.json | 113 +++++++++ .../schemas/cflint-result.schema.json | 222 ++++++++++++++++++ src/main/resources/schemas/cflint-result.xsd | 166 +++++++++++++ 4 files changed, 611 insertions(+), 100 deletions(-) create mode 100644 src/main/resources/schemas/.cflintrc.schema.json create mode 100644 src/main/resources/schemas/cflint-result.schema.json create mode 100644 src/main/resources/schemas/cflint-result.xsd diff --git a/README.md b/README.md index 41e9e4b7e..83d8e0cf9 100644 --- a/README.md +++ b/README.md @@ -3,46 +3,50 @@ CFLint [![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.cflint/CFLint/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.github.cflint/CFLint) [![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/6f4b01d4d2cb4860b60ac666452071f1)](https://www.codacy.com/app/ryaneberly/CFLint?utm_source=github.com&utm_medium=referral&utm_content=cflint/CFLint&utm_campaign=Badge_Grade) [![Build Status](https://travis-ci.org/cflint/CFLint.svg?branch=master)](https://travis-ci.org/cflint/CFLint) ====== -A static code analysis tool for ColdFusion. +A static code analysis tool for CFML. License: [BSD](http://www.opensource.org/licenses/bsd-license.html) -Current Version: 1.2.0 (Jul xx 2017) +Current Version: 1.2.0 (Jul 29 2017) # Versions +<<<<<<< HEAD See [CHANGELOG.md](CHANGELOG.md) for further information. +======= +See [CHANGELOG.md](/CHANGELOG.md) for further information. +>>>>>>> 8a7a538... Added .cflintrc schema and output schemas for JSON and XML. Tweaked README. (#377) # Project and library organisation -CFLint is a project developed and worked on by volunteers. When logging issues please be nice and considerate, we're here to help. We really appreciate fixes and improvements, feel free to talk to us and/or provide pull requests. +CFLint is a project developed and worked on by volunteers. When logging issues please, be nice and considerate. We're here to help. We really appreciate fixes and improvements, so feel free to talk to us and/or provide pull requests. -/src/main contains the source code. Tests can be found in /src/test. CFLint relies heavily on the [CFParser](https://github.com/cfparser/cfparser) project as well as a bunch of 3rd party Java libraries. +`/src/main` contains the source code. Tests can be found in `/src/test`. CFLint relies heavily on the [CFParser](https://github.com/cfparser/cfparser) project as well as a bunch of third-party Java libraries. The master branch is considered our stable codebase. Most of the development happens in the dev branch resp. local development branches for specific issues. - + # Building CFLint 1. Fork the repository into your account and clone or download the codebase as a zip-file. -2. Install the tooling of your choice and build via Gradle or Maven (deprecated). CFlint requires Java 8. +2. Install the tooling of your choice and build via Gradle or Maven (deprecated). CFLint requires Java 8. a. Gradle: execute - + gradlew build - + in the cflint directory b. Maven: execute - + mvn clean install - + in the cflint directory - - Alternatively import the CFLint codebase into the IDE of your choice and use its respectively Gradle/Maven integration. This should work out of the box for Eclipse and IntelliJ users. - -# Using CFLint - Quickstart -Get the latest version from [Maven Central](http://search.maven.org/#search%7Cga%7C1%7Ccflint) or the [CFLint Github release page](https://github.com/cflint/CFLint/releases) or build the project. + Alternatively, import the CFLint codebase into the IDE of your choice and use its respectively Gradle/Maven integration. This should work out of the box for Eclipse and IntelliJ users. + +# Using CFLint - Quickstart Guide + +Get the latest version from [Maven Central](http://search.maven.org/#search%7Cga%7C1%7Ccflint) or the [CFLint GitHub release page](https://github.com/cflint/CFLint/releases) or build the project. If you want to use CFLint from within another Maven project, use: @@ -59,10 +63,10 @@ Or always use the latest: CFLint LATEST - + With the binaries retrieved one or the other way, you can now use CFLint on the command line. -#### Use the "-all"-version of the jar-file: +#### Use the "-all"-version of the jar-file: CFLint-1.2.0-all.jar @@ -71,9 +75,9 @@ With the binaries retrieved one or the other way, you can now use CFLint on the java -jar CFLint-1.2.0-all.jar -folder #### Scan a folder with the complete set of rules: - + java -jar CFLint-1.2.0-all.jar -file - + #### See parameters and help: java -jar CFLint-1.2.0-all.jar -help @@ -84,30 +88,30 @@ With the binaries retrieved one or the other way, you can now use CFLint on the ## Introduction -The most simple options for executing CFLint is via the command line. CFLint currently has a UI mode (triggered by -ui on the command line) which will be removed by the latest for CFLint 2.0 - see [issue 316](https://github.com/cflint/CFLint/issues/316). If you rely on the UI mode, you're unfortunately on your own - no more work will go into this from here onwards. +The simplest options for executing CFLint is via the command line. CFLint currently has a UI mode (triggered by -ui on the command line) which will be removed by the latest for CFLint 2.0 - see [Issue #316](https://github.com/cflint/CFLint/issues/316). If you rely on the UI mode, you're unfortunately on your own - no more work will go into this from here onwards. ## Configuration -Alternatively to the commannd line you can supply a global configuration via the -configfile switch or put .cflintrc files into certain directories. Configuring CFLint this way conceptually allows you to run specific rules in specific parts of your application. +Alternatively to the command line, you can supply a global configuration via the `-configfile` switch or put `.cflintrc` files into certain directories. Configuring CFLint this way conceptually allows you to run specific rules in specific parts of your application. -CFlint currently supports XML- and JSON-based configuration. XML-based configuration will be deprecated in CFLint 1.3.0 and removed in CFLint 2.0. +CFLint currently supports XML- and JSON-based configuration. XML-based configuration will be deprecated in CFLint 1.3.0 and removed in CFLint 2.0. ### Rules -When CFLint executes, it scans and parses your code (using CFParser). The syntax tree is then being examined against a set of built-in rules. In CFLint those rules are called and implemented as plugins (they live in /src/main/java/com/cflint/plugins). By default all rules will be used against your codebase. This is what a lot of people will do, but using configuration allows you to build a custom scenario to test your code against. See RULES.md for more information on rules and their meaning. +When CFLint executes, it scans and parses your code (using CFParser). The syntax tree is then being examined against a set of built-in rules. In CFLint, those rules are called and implemented as plugins (they live in `/src/main/java/com/cflint/plugins`). By default, all rules will be used against your codebase. This is what a lot of people will do, but using configuration allows you to build a custom scenario to test your code against. See [RULES.md](/RULES.md) for more information on rules and their meaning. ### Global configuration -The -configfile options can be used to replace the standard global configuration file. +The `-configfile` options can be used to replace the standard global configuration file. -The standard configuration is src/main/resources/cflint.definition.json. Common usage of CFLint usually does not require replacing this file. +The standard configuration is [`/src/main/resources/cflint.definition.json`](/src/main/resources/cflint.definition.json). Common usage of CFLint usually does not require replacing this file. ### Folder-based configuration -Putting a .cflintrc file into a directory allows you to specify certain rules that should be executed for this directory and its children. Additionally you can specify a handful of other properties. +Putting a `.cflintrc` file into a directory allows you to specify certain rules that should be executed for this directory and its children. Additionally, you can specify a handful of other properties. + +An example `.cflintrc` file is shown below: -An example .cflintrc file is shown below: - { "output" : [ ], "rule" : [ ], @@ -119,19 +123,21 @@ An example .cflintrc file is shown below: "inheritPlugins" : true } -- rule allows you add a plugin for this folder that is not listed in the global configuration. See ruleImpl in cflint.definition.json for examples. +* `rule` allows you add a plugin for this folder that is not listed in the global configuration. See `ruleImpl` in `cflint.definition.json` for examples. -- excludes and includes allow you to specify an array of objects describing rules you want to be applied for this directory and its children. In the example above, the only rule to be checked for will be FUNCTION_HINT_MISSING. +* `excludes` and `includes` allow you to specify an array of objects describing rules you want to be applied for this directory and its children. In the example above, the only rule to be checked for will be FUNCTION_HINT_MISSING. -- inheritParent configures if the rules set in the global or any parent configuration should be inherited as a base set of rules. +* `inheritParent` configures if the rules set in the global or any parent configuration should be inherited as a base set of rules. -- Please note: inheritPlugins and output have been marked deprecated in CFLint 1.2.0 and will be removed in 1.3.0. If you are using .cflintrc files now, please remove the inheritPlugins and output properties as soon as possible. Plugin inheritance will going forward always be treated as true, the team can not see a use case in which it should be disabled. The value of the output attribute is ignored. +* Please note: `inheritPlugins` and `output` have been marked deprecated in CFLint 1.2.0 and will be removed in 1.3.0. If you are using `.cflintrc` files now, please remove the inheritPlugins and output properties as soon as possible. Plugin inheritance will going forward always be treated as true, the team can not see a use case in which it should be disabled. The value of the output attribute is ignored. + +You can find a schema with the deprecated properties excluded [here](/src/main/resources/schemas/.cflintrc.schema.json). ### Annotation-based configuration Quite often there are scenarios in which you would generally want to run a certain set of rules against your code but in specific cases need to ignore an otherwise valid violation. -A common example are violations of CFQUERYPARAM_REQ that can't be fixed by applying because your DB server doesn't allow in a certain position (for instance in a SELECT TOP #arguments.numberOfRecords# ... scenario). See [#282](https://github.com/cflint/CFLint/issues/282) for more examples. +A common example are violations of CFQUERYPARAM_REQ that can't be fixed by applying `` because your DB server doesn't allow `` in a certain position (for instance in a `SELECT TOP #arguments.numberOfRecords# ...` scenario). See [Issue #282](https://github.com/cflint/CFLint/issues/282) for more examples. CFLint offers an annotation-based configuration to deal with this and similar scenarios. Annotations can be placed on the component- or function-level in a CFC or inline with code. @@ -141,16 +147,16 @@ CFLint offers an annotation-based configuration to deal with this and similar sc @CFLintIgnore SOMETHINGELSE,MISSING_VAR,ANOTHERTHINGTOIGNORE ---> -#### CFSCRIPT: +#### CFScript: Ignoring all rules on the current line: //cflint ignore:line - + Ignoring a specific rule (or a comma-separated list of rules) on the current line: - + //cflint ignore:MISSING_VAR - + Multiline ignore annotation: /* @@ -161,19 +167,19 @@ Multiline ignore annotation: Within SQL, you can also use - + to ignore a rule violation on the next line. ### Precendence of configuration settings Configuration of which plugins are run and which rules are included starts with the global configuration and flows through the command line parameters, folder level rules, and down to the annotations within the source. -- global configuration -- custom configuration file (--configfile) -- rule groups (--rulegroups, default behaviour is --rulegroups !Experimental) -- includes/excludes from the command line (--includeRule and --excludeRule) -- .cflintrc - folder level configuration, mostly for including/excluding specific messages -- annotations - explicitly exclude messages in the source code at the tag or line level. +* global configuration +* custom configuration file (--configfile) +* rule groups (--rulegroups, default behaviour is --rulegroups !Experimental) +* includes/excludes from the command line (--includeRule and --excludeRule) +* .cflintrc - folder level configuration, mostly for including/excluding specific messages +* annotations - explicitly exclude messages in the source code at the tag or line level. The configuration rule that is closest to the rule is the one that takes effect. * If an annotation excludes a message, it will not fire regardless of any configuration above it. @@ -181,24 +187,24 @@ The configuration rule that is closest to the rule is the one that takes effect. ## Creating reports -CFLint supports a variety of output options that you can control via command-line flags. If youy want more information about the inner workings of CFLint during execution you can run CFLint in verbose mode by supplying -verbose or -v at the command line. +CFLint supports a variety of output options that you can control via command-line flags. If you want more information about the inner workings of CFLint during execution you can run CFLint in verbose mode by supplying `-verbose` or `-v` at the command line. ### XML -The flag -xml instructs CFLint to create XML. There are two options for XML reporting. +The flag `-xml` instructs CFLint to create XML. There are two options for XML reporting. -The first option is what we call CFlint XML. It's an internal format that adheres to a basic schema. You could then use this format as-is or to do further processing of your choice. +The first option is what we call CFLint XML. It's an internal format that adheres to a basic schema found [here](/src/main/resources/schemas/cflint-result.xsd). You could then use this format as-is or to do further processing of your choice. -The seconds option is Findbugs XML. The resulting XML document adheres to the current version of the Findbugs Bugcollection XML Schema Definition (src/main/resources/findbugs/bugcollection.xsd) and can be used in most CI-/Build-Server products. Jetbrains Team City 10+ can import this format out of the box. +The seconds option is FindBugs XML. The resulting XML document adheres to the current version of the FindBugs BugCollection [XML Schema Definition](src/main/resources/findbugs/bugcollection.xsd) and can be used in most CI-/Build-Server products. JetBrains TeamCity 10+ can import this format out of the box. -Please note: Currently it's not possible to produce BOTH flavours of XML reports at the same time. This is a known limitation. If you feel this hinders your use of CFLint, please raise an issue. +*Please note*: Currently it's not possible to produce BOTH flavours of XML reports at the same time. This is a known limitation. If you feel this hinders your use of CFLint, please raise an issue. #### CFLint XML To create CFLint XML provide the following command-line arguments: -xml -xmlstyle cflint -xmlfile - + Example of CFLint XML: @@ -214,19 +220,19 @@ Example of CFLint XML: ... - + -#### Findbugs XML +#### FindBugs XML -To create Findbugs XML provide the following command-line arguments: +To create FindBugs XML provide the following command-line arguments: -xml -xmlstyle findbugs -xmlfile - -The Findbugs XML format is currently created using an XSLT document, transforming the CFLint report to Findbugs XML (src/main/resources/findbugs/cflint-to-findbugs.xsl). + +The FindBugs XML format is currently created using an XSLT document, transforming the CFLint report to FindBugs XML ([`/src/main/resources/findbugs/cflint-to-findbugs.xsl`](/src/main/resources/findbugs/cflint-to-findbugs.xsl)). ### JSON @@ -237,7 +243,7 @@ JSON output can be created with Example of CFLint JSON: { - "version" : "", + "version" : "1.2.0", "timestamp" : "1501202128", "issues" : [ { "severity" : "ERROR", @@ -270,12 +276,14 @@ Example of CFLint JSON: } } +The JSON schema is available [here](/src/main/resources/schemas/cflint-result.schema.json). + ### Text Plain text output can be created with -text -textfile - + Example of plain text output: Issue @@ -285,27 +293,27 @@ Example of plain text output: Column:0 Line:79 Message: should use for variable 'arguments.something'. - Variable:'arguments.something' in function: + Variable:'arguments.something' in function: Expression:\r\n...some Details... - + Severity:WARNING Message code:CFQUERYPARAM_REQ File:/Users/kai/Documents/Code/paypal.cfc Column:0 Line:145 Message: should use for variable 'arguments.something'. - Variable:'arguments.something' in function: + Variable:'arguments.something' in function: Expression:\r\n...some Details... - - ... - - + + ... + + Total files:108 Total lines:55690 - + Issue counts:1 CFQUERYPARAM_REQ:4 - + Total issues:4 Total warnings:4 @@ -313,25 +321,27 @@ Example of plain text output: ## Integration server support -For Jenkins, please look at the Jenkins/Hudson plugin mentioned further below. +For Jenkins, please look at the Jenkins/Hudson plugin mentioned further below. -Jetbrains' TeamCity has support for Findbugs XML code inspection reports. They can be produced out of the box with CFLint from 1.2.0 onwards (see above in the Findbugs XML section). +JetBrains' TeamCity has support for FindBugs XML code inspection reports. They can be produced out of the box with CFLint from 1.2.0 onwards (see above in the [FindBugs XML section](#findbugs-xml)). -There is support for SonarQube through Stepstone's Sonar ColdFusion plugin mentioned further below. +There is support for SonarQube through StepStone's Sonar ColdFusion plugin mentioned further below. -There's an NPM wrapper for CLint below. Please be aware that the wrapper seems to come with its own bundled CFLint binary which might not be up to date, which is outside of our control. +There's an NPM wrapper for CFLint below. Please be aware that the wrapper seems to come with its own bundled CFLint binary which might not be up-to-date, which is outside of our control. -Other products in the integeration/build server category might work, too. If you're using a specific product that works for you with CFLint please let us know. If you can't get CFLint to work in an environment you use, please let us know as well - we might be able to help. +Other products in the integration/build server category might work, too. If you're using a specific product that works for you with CFLint please let us know. If you can't get CFLint to work in an environment you use, please let us know as well - we might be able to help. ## IDE support -Currently there is IDE support for Sublime through a 3rd-party project (see below). +Currently there is IDE support for Sublime Text through a third-party project (see below). -There is also support for Adobe's CFBuilder through a 3rd-party project (see below). Users of CFBuilder, please also see the discussion in issue [#327](https://github.com/cflint/CFLint/issues/327). +There is also support for Adobe's ColdFusion Builder through a third-party project (see below). Users of CFBuilder, please also see the discussion in issue [#327](https://github.com/cflint/CFLint/issues/327). -Users of Atom can integrate with AtomLinter through a 3rd-party project (see below). +Users of Atom can integrate with AtomLinter through a third-party project (see below). -Support for Jetbrains' IntelliJ is planned; talk to [@TheRealAgentK](https://github.com/TheRealAgentK) for more info if you're interested. +Support for JetBrains' IntelliJ is planned; talk to [@TheRealAgentK](https://github.com/TheRealAgentK) for more info if you're interested. + +An extension for Visual Studio Code will be released in the near future. ## Extending CFLint @@ -343,14 +353,14 @@ Support for Jetbrains' IntelliJ is planned; talk to [@TheRealAgentK](https://git import cfml.parsing.cfscript.script.CFFuncDeclStatement; import cfml.parsing.cfscript.script.CFFunctionParameter; import cfml.parsing.cfscript.script.CFScriptStatement; - + import com.cflint.BugList; import com.cflint.plugins.CFLintScannerAdapter; import com.cflint.plugins.Context; import com.cflint.tools.CFTool; - + public class ArgDefChecker extends CFLintScannerAdapter { - + @Override public void expression(final CFScriptStatement expression, final Context context, final BugList bugs) { if (expression instanceof CFFuncDeclStatement) { @@ -366,7 +376,7 @@ Support for Jetbrains' IntelliJ is planned; talk to [@TheRealAgentK](https://git } } } - + @Override public void element(final Element element, final Context context, final BugList bugs) { if (element.getName().equals("cfargument")) { @@ -387,19 +397,19 @@ Looking at the function `element`, the arguments are: * context - the current file being checked * bugs - the appending object of violations -# Receipes +# Recipes ## Ignoring a directory for processing -The easiest way to achieve this is with a custom .cflintrc file: +The easiest way to achieve this is with a custom `.cflintrc` file: -The includes field is ignored if it is an empty list, so simply add a single item to it for which nothing matches. +The `includes` field is ignored if it is an empty list, so simply add a single item to it for which nothing matches. { "code" : "NOTHING" } -or simply: +or more simply: {} @@ -410,13 +420,13 @@ The following will ignore all rules in the current folder and below. "output" : [ ], "rule" : [ ], "excludes" : [ ], - "includes" : [ {}], + "includes" : [ {} ], "inheritParent" : false, "inheritPlugins" : true } -This can be simplified using the default values of a .cflintrc file: +This can be simplified using the default values of a `.cflintrc` file: { "includes" : [{}], @@ -428,10 +438,10 @@ See the discussion in [#290](https://github.com/cflint/CFLint/issues/290) for mo ## Filtering out specific processing results in specific folders -Supply a cflintexclude.json file in ??? ----TO DO START -Where would such a file go? ----TO DO END +Supply a `cflintexclude.json` file in ??? +---TO DO START +Where would such a file go? +---TO DO END #### Example @@ -456,27 +466,27 @@ Note: The back slashes must be escaped twice, once for JSON, once for regular ex # Support -Raise issues here on Github and we will look at them. +Raise issues here on GitHub and we will look at them. -The [CFML Slack team](http://cfml-slack.herokuapp.com/) has a #cflint channel you can join and talk to most of the regular contributors and other users. +The [CFML Slack team](http://cfml-slack.herokuapp.com/) has a `#cflint` channel you can join and talk to most of the regular contributors and other users. # How to contribute? -See CONTRIBUTING.md for further information +See [CONTRIBUTING.md](/CONTRIBUTING.md) for further information. -# Interesting 3rd-party projects +# Interesting third-party projects Please note that the majority of the libraries and projects mentioned here are not directly related to and maintained by the CFLint team. Please see the authors and maintainers of the respective project for support using their libraries first. -- [Jenkins/Hudson plugin](https://github.com/jenkinsci/CFLint-plugin) for CFLint -- [SublimeLinter plugin](https://github.com/ckaznocha/SublimeLinter-contrib-CFLint) for CFlint -- [CFBuilder plugin](https://github.com/cfjedimaster/CFLint-Extension) for CFLint -- [Atom plugin](https://github.com/ditinc/linter-cflint) for CFLint -- [Sonar plugin](https://github.com/stepstone-tech/sonar-coldfusion) -- [NPM wrapper](https://github.com/morgdenn/npm-cflint) -- Vim [Syntastic support for CFLint](https://github.com/cflint/cflint-syntastic) +* [Jenkins/Hudson plugin](https://github.com/jenkinsci/CFLint-plugin) +* [Sublime Text plugin](https://github.com/ckaznocha/SublimeLinter-contrib-CFLint) +* [ColdFusion Builder plugin](https://github.com/cfjedimaster/CFLint-Extension) +* [Atom plugin](https://github.com/ditinc/linter-cflint) +* [Sonar plugin](https://github.com/stepstone-tech/sonar-coldfusion) +* [NPM wrapper](https://github.com/morgdenn/npm-cflint) +* Vim [Syntastic support for CFLint](https://github.com/cflint/cflint-syntastic) diff --git a/src/main/resources/schemas/.cflintrc.schema.json b/src/main/resources/schemas/.cflintrc.schema.json new file mode 100644 index 000000000..8450c51f3 --- /dev/null +++ b/src/main/resources/schemas/.cflintrc.schema.json @@ -0,0 +1,113 @@ +{ + "$schema": "http://json-schema.org/schema#", + "definitions": { + "pluginMessage": { + "title": "Plugin Message", + "type": "object", + "properties": { + "code": { + "title": "Code", + "description": "The code that represents the rule or type of issue", + "type": "string" + }, + "messageText": { + "title": "Message Text", + "description": "The message text to be displayed for this issue", + "type": "string" + }, + "severity": { + "title": "Severity", + "description": "The severity level of the issue", + "type": "string", + "enum": [ + "FATAL", + "CRITICAL", + "ERROR", + "WARNING", + "CAUTION", + "INFO", + "COSMETIC" + ] + } + } + } + }, + "title": "Rules Configuration", + "description": "A set of rules configuration options for CFLint", + "type": "object", + "properties": { + "rule": { + "title": "Rules", + "description": "Allows you to add a plugin for this folder that is not listed in the global configuration", + "type": "array", + "minItems": 0, + "items": { + "title": "Rule", + "type": "object", + "properties": { + "name": { + "title": "Name", + "type": "string" + }, + "className": { + "title": "Class Name", + "type": "string" + }, + "message": { + "title": "Messages", + "type": "array", + "minItems": 0, + "items": { + "$ref": "#/definitions/pluginMessage" + } + }, + "parameter": { + "title": "Parameters", + "type": "array", + "minItems": 0, + "items": { + "title": "Parameter", + "type": "object", + "properties": { + "name": { + "title": "Name", + "type": "string" + }, + "value": { + "title": "Value" + } + } + } + } + } + }, + "default": [] + }, + "excludes": { + "title": "Excludes", + "description": "An array of objects describing rules you want to be excluded from this directory and its children", + "type": "array", + "minItems": 0, + "items": { + "$ref": "#/definitions/pluginMessage" + }, + "default": [] + }, + "includes": { + "title": "Includes", + "description": "An array of objects describing rules you want to be applied for this directory and its children", + "type": "array", + "minItems": 0, + "items": { + "$ref": "#/definitions/pluginMessage" + }, + "default": [] + }, + "inheritParent": { + "title": "Inherit Parent", + "description": "Configures if the rules set in the global or any parent configuration should be inherited as a base set of rules", + "type": "boolean", + "default": true + } + } +} \ No newline at end of file diff --git a/src/main/resources/schemas/cflint-result.schema.json b/src/main/resources/schemas/cflint-result.schema.json new file mode 100644 index 000000000..261250cfd --- /dev/null +++ b/src/main/resources/schemas/cflint-result.schema.json @@ -0,0 +1,222 @@ +{ + "$schema": "http://json-schema.org/schema#", + "title": "Result", + "description": "Represents the result of running CFLint", + "type": "object", + "properties": { + "version": { + "title": "Version", + "description": "The version of CFLint that products these results", + "type": "string" + }, + "timestamp": { + "title": "Timestamp", + "description": "A timestamp representing the Unix epoch time when these results were generated", + "type": "string" + }, + "issues": { + "title": "Issues", + "description": "A list of issues reported by CFLint", + "type": "array", + "items": { + "title": "Issue", + "description": "Represents each issue found", + "type": "object", + "properties": { + "severity": { + "title": "Severity", + "description": "The severity level of the issue", + "type": "string", + "enum": [ + "FATAL", + "CRITICAL", + "ERROR", + "WARNING", + "CAUTION", + "INFO", + "COSMETIC" + ] + }, + "id": { + "title": "ID", + "description": "Unique identifier of the rule used to find the issue", + "type": "string" + }, + "message": { + "title": "Message", + "description": "Same as ID", + "type": "string" + }, + "category": { + "title": "Category", + "description": "Currently always contains CFLINT", + "type": "string", + "default": "CFLINT" + }, + "abbrev": { + "title": "Abbreviation", + "description": "An abbreviation of the rule used to find the issue", + "type": "string" + }, + "locations": { + "title": "Locations", + "description": "A list of locations that the issue occurs", + "type": "array", + "items": { + "title": "Location", + "description": "Properties of the individual issue reported", + "type": "object", + "properties": { + "file": { + "title": "File", + "description": "Full file path to the file in which the issue was found", + "type": "string" + }, + "fileName": { + "title": "File name", + "description": "Just the file name in which the issue was found", + "type": "string" + }, + "function": { + "title": "Function", + "description": "The function in which or for which the issue was found", + "type": "string" + }, + "column": { + "title": "Column", + "description": "The column number of the starting position at which the issue was found", + "type": "number" + }, + "line": { + "title": "Line", + "description": "The line number of the starting position at which the issue was found", + "type": "number" + }, + "message": { + "title": "Message", + "description": "A message describing this specific issue", + "type": "string" + }, + "variable": { + "title": "Variable", + "description": "The variable name for which the issue was found", + "type": "string" + }, + "expression": { + "title": "Expression", + "description": "The expression in which the issue was found", + "type": "string" + } + }, + "required": [ + "file", + "fileName", + "function", + "column", + "line", + "message", + "variable", + "expression" + ] + }, + "minItems": 1 + } + }, + "required": [ + "severity", + "id", + "message", + "category", + "abbrev", + "locations" + ] + }, + "default": [] + }, + "counts": { + "title": "Counts", + "description": "Provides counts for the results of running CFLint", + "type": "object", + "properties": { + "totalFiles": { + "title": "Total Files", + "description": "The total number of files read during this scan", + "type": "number", + "default": 0 + }, + "totalLines": { + "title": "Total Lines", + "description": "The total number of lines of code scanned", + "type": "number", + "default": 0 + }, + "countByCode": { + "title": "Count by Code", + "description": "List of issue codes with their respective issue counts", + "type": "array", + "items": { + "title": "Code Count", + "description": "The count of issues found for each distinct issue code", + "type": "object", + "properties": { + "code": { + "title": "Current Code", + "description": "The current issue code being counted", + "type": "string" + }, + "count": { + "title": "Current Count", + "description": "The issue count for the current issue code", + "type": "number" + } + }, + "required": [ + "code", + "count" + ] + }, + "default": [] + }, + "countBySeverity": { + "title": "Count by Severity", + "description": "List of issue severities with their respective issue counts", + "type": "array", + "items": { + "title": "Severity Count", + "description": "The count of issues found for each distinct issue severity", + "type": "object", + "properties": { + "severity": { + "title": "Current Severity", + "description": "The current issue severity being counted", + "type": "string" + }, + "count": { + "title": "Current Count", + "description": "The issue count for the current severity", + "type": "number" + } + }, + "required": [ + "severity", + "count" + ] + }, + "default": [] + } + }, + "required": [ + "totalFiles", + "totalLines", + "countByCode", + "countBySeverity" + ] + } + }, + "required": [ + "version", + "timestamp", + "issues", + "counts" + ] +} \ No newline at end of file diff --git a/src/main/resources/schemas/cflint-result.xsd b/src/main/resources/schemas/cflint-result.xsd new file mode 100644 index 000000000..f487dc99d --- /dev/null +++ b/src/main/resources/schemas/cflint-result.xsd @@ -0,0 +1,166 @@ + + + + This schema describes the XML format used by CFLint to store the results of analysis. + + + + + The severity level of an issue + + + + + + + + + + + + + + + + + + Represents each issue found + + + + + + Properties of the individual issue reported + + + + + + The expression in which the issue was found + + + + + + Full file path to the file in which the issue was found + + + + + Just the file name in which the issue was found + + + + + The function in which or for which the issue was found + + + + + The column number of the starting position at which the issue was found + + + + + The line number of the starting position at which the issue was found + + + + + A message describing this specific issue + + + + + The variable name for which the issue was found + + + + + + + + The severity level of the issue + + + + + Unique identifier of the rule used to find the issue + + + + + Same as ID + + + + + Currently always set to CFLint + + + + + An abbreviation of the rule used to find the issue + + + + + + + Provides counts for the results of running CFLint + + + + + + Provides counts grouped by code or severity + + + + + + + The current issue code being counted + + + + + The current issue severity being counted + + + + + The issue count for the current code or severity + + + + + + + + + + The total number of files read during this scan + + + + + The total number of lines of code scanned + + + + + + + + The version of CFLint that products these results + + + + + A timestamp representing the Unix epoch time when these results were generated + + + + + \ No newline at end of file From a5a3245898986cc8db249efab6206563bbe8dbde Mon Sep 17 00:00:00 2001 From: KamasamaK Date: Sat, 29 Jul 2017 19:21:48 -0400 Subject: [PATCH 2/4] Update README --- README.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/README.md b/README.md index 83d8e0cf9..ee7811fa4 100644 --- a/README.md +++ b/README.md @@ -11,11 +11,7 @@ Current Version: 1.2.0 (Jul 29 2017) # Versions -<<<<<<< HEAD -See [CHANGELOG.md](CHANGELOG.md) for further information. -======= See [CHANGELOG.md](/CHANGELOG.md) for further information. ->>>>>>> 8a7a538... Added .cflintrc schema and output schemas for JSON and XML. Tweaked README. (#377) # Project and library organisation From 755f4909d0cdd56e41f9f8921498ae6eb60c24b2 Mon Sep 17 00:00:00 2001 From: ryaneberly Date: Sat, 29 Jul 2017 21:48:35 -0400 Subject: [PATCH 3/4] Update CHANGELOG.md --- CHANGELOG.md | 169 +++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 163 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f45d4a19a..2b7bb6a64 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,167 @@ History -======= - -1.2.0 (Jul xx 2017) -- We did stuff -- We did some other stuff -- And fixed some stuff +======= +## CFLint1.2.0 +##### GitHub [#152](https://github.com/cflint/CFLint/issues/152) UNUSED_METHOD_ARGUMENT ignores scoped arguments +##### GitHub [#158](https://github.com/cflint/CFLint/issues/158) multiple location members in JSON output +##### GitHub [#171](https://github.com/cflint/CFLint/issues/171) XML Output : MalformedByteSequenceException: Invalid byte 1 of 1-byte UTF-8 sequence +##### GitHub [#173](https://github.com/cflint/CFLint/issues/173) Exclude rule for all INFO severity messages, excludes all messages +##### GitHub [#179](https://github.com/cflint/CFLint/issues/179) CFLint - wrong line number in XML report +##### GitHub [#182](https://github.com/cflint/CFLint/issues/182) Named arguments in functions +##### GitHub [#185](https://github.com/cflint/CFLint/issues/185) configfile excludes rules +##### GitHub [#186](https://github.com/cflint/CFLint/issues/186) Doesn't seem to be checking missing_var on cfscript cfcs +##### GitHub [#192](https://github.com/cflint/CFLint/issues/192) Directory Scan +##### GitHub [#194](https://github.com/cflint/CFLint/issues/194) Config system for includes/excludes is misleading (or broken) +##### GitHub [#195](https://github.com/cflint/CFLint/issues/195) Support a way to ignore found issues in the future. +##### GitHub [#197](https://github.com/cflint/CFLint/issues/197) False positive: structure keys reported as variables without scope prefix +##### GitHub [#198](https://github.com/cflint/CFLint/issues/198) New rule for specifying structure key names in quotation marks +##### GitHub [#199](https://github.com/cflint/CFLint/issues/199) Rules reporting missing hints should work with script-style code +##### GitHub [#208](https://github.com/cflint/CFLint/issues/208) Incorrect line number in XML export when previously scanned CFML-based file +##### GitHub [#211](https://github.com/cflint/CFLint/issues/211) False positive variable used in loop reported as unused +##### GitHub [#212](https://github.com/cflint/CFLint/issues/212) Where does cflint-ui come from? +##### GitHub [#220](https://github.com/cflint/CFLint/issues/220) Linter does not check code inside cfscript try/catch/finally blocks +##### GitHub [#223](https://github.com/cflint/CFLint/issues/223) Duplicate "Temporary variable could be named better" warnings +##### GitHub [#243](https://github.com/cflint/CFLint/issues/243) Parse error when multiple spaces in CFML tag +##### GitHub [#253](https://github.com/cflint/CFLint/issues/253) CFML analysis tries to parse tags inside strings/literals +##### GitHub [#254](https://github.com/cflint/CFLint/issues/254) Variable Prefix and Postfix - More dynamic +##### GitHub [#256](https://github.com/cflint/CFLint/issues/256) Var 'declared' with local scope. +##### GitHub [#257](https://github.com/cflint/CFLint/issues/257) Does not see argument as used when it is used in brackets inside of function. +##### GitHub [#260](https://github.com/cflint/CFLint/issues/260) Default Rules merging with config.xml +##### GitHub [#262](https://github.com/cflint/CFLint/issues/262) feaure: flag use of isDate() +##### GitHub [#265](https://github.com/cflint/CFLint/issues/265) Identifier cfcatch is global, referencing in a CFC or function should be avoided. +##### GitHub [#267](https://github.com/cflint/CFLint/issues/267) Is it possible for dot paths to alert when case doesn't match +##### GitHub [#269](https://github.com/cflint/CFLint/issues/269) Unclear error messages: Error in plugin, 0 +##### GitHub [#271](https://github.com/cflint/CFLint/issues/271) Findbugs XML output creates <?xml...?> tag twice +##### GitHub [#272](https://github.com/cflint/CFLint/pull/272) Fix for #271 +##### GitHub [#278](https://github.com/cflint/CFLint/issues/278) Additions to CFLint XML (was: Building a mechanism to pass timestamps and additional counters into FIndbugs XML) +##### GitHub [#282](https://github.com/cflint/CFLint/issues/282) CFQUERYPARAM_REQ false positives +##### GitHub [#284](https://github.com/cflint/CFLint/issues/284) MISSING_VAR false positive cfquery loops +##### GitHub [#285](https://github.com/cflint/CFLint/issues/285) Script ignore syntax fails in mixed cfscript/tag code +##### GitHub [#290](https://github.com/cflint/CFLint/issues/290) How to use .cflintrc to ignore a directory? +##### GitHub [#291](https://github.com/cflint/CFLint/issues/291) Empty files report FILE_ERROR +##### GitHub [#293](https://github.com/cflint/CFLint/issues/293) Stack overflow in dev branch +##### GitHub [#295](https://github.com/cflint/CFLint/issues/295) Allowing to ignore CFQUERYPARAM_REQ with SQL code +##### GitHub [#296](https://github.com/cflint/CFLint/pull/296) Retrospective fix for test case for #282 (and reopened #195) +##### GitHub [#299](https://github.com/cflint/CFLint/issues/299) Move old bug count logic for output into cflintstats +##### GitHub [#300](https://github.com/cflint/CFLint/issues/300) XML output with findbugs style should have -showStats set implicitly +##### GitHub [#301](https://github.com/cflint/CFLint/issues/301) HTML outputs are broken +##### GitHub [#303](https://github.com/cflint/CFLint/issues/303) Findbugs: totalsize should be lines of code scanned +##### GitHub [#315](https://github.com/cflint/CFLint/issues/315) inheritPlugins in .cflintrc should be always true +##### GitHub [#318](https://github.com/cflint/CFLint/issues/318) JSON output questions (int/string and locations array) +##### GitHub [#321](https://github.com/cflint/CFLint/pull/321) 290 parse error +##### GitHub [#323](https://github.com/cflint/CFLint/issues/323) Various smaller issues with output +##### GitHub [#326](https://github.com/cflint/CFLint/issues/326) CFLint reporting a column that doesn't exist +##### GitHub [#330](https://github.com/cflint/CFLint/issues/330) DefaultCFLintMarshaller doesn't have any of the CFLint XML improvements in XMLOutput +##### GitHub [#336](https://github.com/cflint/CFLint/issues/336) AVOID_EMPTY_FILES being reported if file doesn't exist +##### GitHub [#339](https://github.com/cflint/CFLint/issues/339) Rule UNUSED_LOCAL_VARIABLE has issues with several tags +##### GitHub [#340](https://github.com/cflint/CFLint/issues/340) GLOBAL_LITERAL_VALUE_USED_TOO_OFTEN triggered on CF_SQL_ +##### GitHub [#341](https://github.com/cflint/CFLint/pull/341) Fix for test fail on case-insensitive filesystems +##### GitHub [#343](https://github.com/cflint/CFLint/pull/343) Lighten ANTLR dependencies +##### GitHub [#344](https://github.com/cflint/CFLint/issues/344) GLOBAL_LITERAL_VALUE_USED_TOO_OFTEN triggered by built in function arguments +##### GitHub [#345](https://github.com/cflint/CFLint/issues/345) GLOBAL_LITERAL_VALUE_USED_TOO_OFTEN falsely indicated in CFM files with <cfinclude> +##### GitHub [#347](https://github.com/cflint/CFLint/issues/347) PARSE_ERROR on component with a name coinciding with one instantiated elsewhere +##### GitHub [#348](https://github.com/cflint/CFLint/pull/348) Update to cfparser 2.4.9 +##### GitHub [#352](https://github.com/cflint/CFLint/issues/352) Document .cflintrc schema +##### GitHub [#353](https://github.com/cflint/CFLint/pull/353) Dev +##### GitHub [#356](https://github.com/cflint/CFLint/issues/356) Remove and deprecate "output" on top-level of .cflintrc +##### GitHub [#357](https://github.com/cflint/CFLint/issues/357) PARSE_ERROR when cfloop has "delimiters" attribute +##### GitHub [#359](https://github.com/cflint/CFLint/issues/359) PARSE_ERROR when concatenating strings with single quotes +##### GitHub [#361](https://github.com/cflint/CFLint/issues/361) Add contributing guidelines document +##### GitHub [#362](https://github.com/cflint/CFLint/issues/362) Config file usage +##### GitHub [#363](https://github.com/cflint/CFLint/issues/363) Maven build fails using the ZIP file from GitHub since it needs the `.git` folder +##### GitHub [#366](https://github.com/cflint/CFLint/issues/366) ANTLR Tool version 4.6 mismatch +##### GitHub [#370](https://github.com/cflint/CFLint/pull/370) #323 - Changing JSON structure and changing expected test results +##### No issue +## CFLint-1.0.1 +##### GitHub [#103](https://github.com/cflint/CFLint/issues/103) Enhancement: Enable default config file when parsing similar to other linters +##### GitHub [#114](https://github.com/cflint/CFLint/issues/114) Group and decide which linting rules to include by default. +##### GitHub [#194](https://github.com/cflint/CFLint/issues/194) Config system for includes/excludes is misleading (or broken) +##### GitHub [#222](https://github.com/cflint/CFLint/issues/222) "if" without an "else" triggers "Nothing to parse" warning +##### GitHub [#224](https://github.com/cflint/CFLint/issues/224) --version should include CFParser version +##### GitHub [#226](https://github.com/cflint/CFLint/issues/226) infinite loop in recent builds, triggering segmentation fault +##### GitHub [#227](https://github.com/cflint/CFLint/issues/227) False positive for unused argument when argument is scoped +##### GitHub [#228](https://github.com/cflint/CFLint/issues/228) Multiple code: is not configured correctly +##### GitHub [#229](https://github.com/cflint/CFLint/issues/229) Parsing error with nested if()? +##### GitHub [#230](https://github.com/cflint/CFLint/issues/230) Incorrect error in line 0 when CFML parsing encounters cfscript-like not-equals +##### GitHub [#234](https://github.com/cflint/CFLint/issues/234) Not accounting for switch statements +##### GitHub [#235](https://github.com/cflint/CFLint/pull/235) Add a Codacy badge to README.md +##### GitHub [#239](https://github.com/cflint/CFLint/issues/239) Ignore VAR_ALL_CAPS for components +##### GitHub [#241](https://github.com/cflint/CFLint/issues/241) XML report includes semicolon after PLUGIN_ERROR id and message +##### GitHub [#242](https://github.com/cflint/CFLint/issues/242) Should recognize variables used with differing case +##### GitHub [#244](https://github.com/cflint/CFLint/issues/244) PLUGIN_ERROR on assignment to camel-case variable +##### GitHub [#245](https://github.com/cflint/CFLint/issues/245) Incorrect PLUGIN_ERROR issue ID with appended exception name +##### GitHub [#246](https://github.com/cflint/CFLint/issues/246) Detect when assigning to a variable declared as component property +##### GitHub [#247](https://github.com/cflint/CFLint/pull/247) Update SureFire argLine +##### GitHub [#248](https://github.com/cflint/CFLint/issues/248) Component name missing from message for COMPONENT_INVALID_NAME +##### GitHub [#250](https://github.com/cflint/CFLint/issues/250) Analysis tripped up over UTF-8 files with BOM +##### No issue +## CFLint-0.6.1 +##### No issue +## v0.6.0 +##### GitHub [#104](https://github.com/cflint/CFLint/issues/104) Weird messaging for missing semicolon +##### GitHub [#105](https://github.com/cflint/CFLint/issues/105) Warnings for non-existing errors and non-lint errors before output. +##### GitHub [#62](https://github.com/cflint/CFLint/issues/62) JSON output +##### GitHub [#67](https://github.com/cflint/CFLint/issues/67) Gradle Install +##### GitHub [#80](https://github.com/cflint/CFLint/issues/80) Gradle Deployment +##### GitHub [#95](https://github.com/cflint/CFLint/issues/95) support json config instead of xml +##### No issue +## CFLint0.5.1 +##### GitHub [#65](https://github.com/cflint/CFLint/issues/65) Problem with dynamic table and field names +##### GitHub [#66](https://github.com/cflint/CFLint/issues/66) cflint-disable / cflint-enable ? +##### GitHub [#71](https://github.com/cflint/CFLint/issues/71) Unable to exclude rules +##### GitHub [#89](https://github.com/cflint/CFLint/pull/89) Rule to check for writeDump in cfset tags and script blocks +##### GitHub [#97](https://github.com/cflint/CFLint/issues/97) Release 0.5.1-SNAPSHOT +##### No issue +## v0.5 +##### GitHub [#33](https://github.com/cflint/CFLint/issues/33) no cflint version could be extracted with SublimeLinter +##### GitHub [#35](https://github.com/cflint/CFLint/issues/35) CFLint Should Download Latest Version of CFParser +##### GitHub [#36](https://github.com/cflint/CFLint/issues/36) Add Ability to Preview CFParser Snapshots from Sonatype. +##### GitHub [#38](https://github.com/cflint/CFLint/issues/38) CFLint-ui asking for 4G of Memory +##### GitHub [#42](https://github.com/cflint/CFLint/issues/42) maven build instructions should address common distribution requirements +##### GitHub [#45](https://github.com/cflint/CFLint/issues/45) Lint of cfprocresult fails in function when array is used. +##### GitHub [#49](https://github.com/cflint/CFLint/issues/49) Unable to Parse QueryExecute Functions +##### GitHub [#51](https://github.com/cflint/CFLint/issues/51) maven install should install the binaries in a usable way +##### GitHub [#56](https://github.com/cflint/CFLint/issues/56) Build failure +##### GitHub [#58](https://github.com/cflint/CFLint/issues/58) change license to BSD +##### GitHub [#59](https://github.com/cflint/CFLint/issues/59) Issue with pom.xml file +##### GitHub [#60](https://github.com/cflint/CFLint/issues/60) Having trouble using filterFile +##### GitHub [#62](https://github.com/cflint/CFLint/issues/62) JSON output +##### GitHub [#63](https://github.com/cflint/CFLint/issues/63) Release v0.5.0 +##### No issue +## CFLint-0.4-release +##### GitHub [#19](https://github.com/cflint/CFLint/issues/19) Convert bugs.add() to a plugin format. +##### GitHub [#21](https://github.com/cflint/CFLint/issues/21) <cfset/> on multiple lines does not process +##### GitHub [#24](https://github.com/cflint/CFLint/issues/24) parse error "can't look backwards more than one token in this stream" +##### GitHub [#25](https://github.com/cflint/CFLint/issues/25) Default cflintexclude.json should only ignore MISSING_VAR's in init() functions, other violations should NOT be ignored +##### GitHub [#26](https://github.com/cflint/CFLint/issues/26) QUERYPARAM_REQ message should reflect the cf tag version not the cf script version. +##### GitHub [#27](https://github.com/cflint/CFLint/issues/27) Maven build fails with error. +##### GitHub [#30](https://github.com/cflint/CFLint/issues/30) NESTED_CFOUTPUT false positive +##### GitHub [#31](https://github.com/cflint/CFLint/issues/31) Trying out the configfile from the command line and getting errors +##### No issue +## CFLint-0.4 +##### No issue +## CFLint-0.3.0 +##### No issue +## CFLint-0.2.0 +##### GitHub [#11](https://github.com/cflint/CFLint/issues/11) Multiple exceptions in output +##### GitHub [#2](https://github.com/cflint/CFLint/issues/2) Specifying -textfile as an argument, implies -text should be set. +##### GitHub [#4](https://github.com/cflint/CFLint/issues/4) It would be useful to have a -q (--quiet) option +##### GitHub [#6](https://github.com/cflint/CFLint/issues/6) Add -version flag +##### GitHub [#7](https://github.com/cflint/CFLint/issues/7) Add severity level to each issue in stdout +##### GitHub [#8](https://github.com/cflint/CFLint/issues/8) does not support tagless components +##### No issue +## CFLint-0.1.8 +##### No issue +## CFLint-0.1.6 +##### GitHub [#1](https://github.com/cflint/CFLint/issues/1) ignore .cfm~ files +##### No issue +## CFLint-0.1.5 +##### No issue +## CFLint-0.1.4 +##### No issue +## CFLint-0.1.3 +##### No issue +## CFLint-0.1.2 +##### No issue From fd336655bb82776e693bc7c3d33ef249a1b44c7b Mon Sep 17 00:00:00 2001 From: ryaneberly Date: Wed, 9 Aug 2017 22:42:58 -0400 Subject: [PATCH 4/4] Dev prep 1.2.1 release (#415) * Remove dependency copying (#376) There doesn't seem to be a reason to have this phase. Perhaps there was one before? All the required dependencies are added to the final JAR by the `maven-shade-plugin` in the `package` phase anyway. This dependency copying just seems like a waste of time. * Add .editorconfig Provides common whitespace settings for all editors. Supported out of the box in some IDE's (like IntelliJ IDEA) and all others have appropriate plugins. * Added .cflintrc schema and output schemas for JSON and XML. Tweaked README. (#377) Added .cflintrc schema and output schemas for JSON and XML. Tweaked README. * support autochange * #382 * Align Gradle dependencies with Maven ones (#378) Define the same set (and scopes) of dependencies for Gradle builds as we have now in Maven's `pom.xml`. * Added some context to the changelog for 1.2.0 and removed a lot of "##### no issues" items that were added to the list. * Changed setting for auto-adding a final new line, that screws up expected files for tests. * #383 Changed code, test, README with the output sample and JSON schema. * Update timestamp type in result schemas * #385 Two small modifications to HTML report * Changed build versions to 1.2.1-SNAPSHOT in dev branch and change documentation to 1.2.1 in dev branch. * 390 Add Implementation-Version to MANIFEST Configures the Maven and Gradle builds to include `Implementation-Version` in the MANIFEST.MF file, which can then be read by the application and displayed to the user. * #385 - Further HTML report improvements * #390 - Adapting new way to grab version string * #390 - Hopefully fixing Gradle build * #390 - Review changes * #396 fixed * Update README.md Explains how to pass multiple arguments in the command line in Windows Powershell and fixes a typo. Fixes #400 * Update CODE_OF_CONDUCT.md * #380 fixed * Added VS Code info. Some cleanup. * use cfparser 2.4.11 * #408 * #373 * #367 * #367 * add sonatype repo * merged master * cfparser 2.5.0 * Added test for #359 showing parsing error gone with cfparser 2.5.0 * #359 use parseCFMLExpression * fix tests * test for #346 * #413 * fix test * fix javadoc --- .editorconfig | 7 + CHANGELOG.md | 30 +- CODE_OF_CONDUCT.md | 2 +- README.md | 84 ++- build.gradle | 36 +- gradle.properties | 2 +- pom.xml | 34 +- src/main/java/com/cflint/CFLint.java | 420 +++++++------ src/main/java/com/cflint/JSONOutput.java | 2 +- src/main/java/com/cflint/Version.java | 32 +- src/main/java/com/cflint/main/CFLintMain.java | 4 + src/main/java/com/cflint/plugins/Context.java | 12 +- .../plugins/core/QueryParamChecker.java | 4 +- .../plugins/core/TooManyFunctionsChecker.java | 16 +- .../com/cflint/plugins/core/VarScoper.java | 12 - .../java/com/cflint/tools/CFMLTagInfo.java | 44 ++ src/main/resources/cflint.definition.json | 2 +- src/main/resources/changelog.mustache | 21 + src/main/resources/findbugs/default.xsl | 32 +- src/main/resources/findbugs/plain.xsl | 564 +++++++++--------- .../schemas/cflint-result.schema.json | 2 +- src/main/resources/schemas/cflint-result.xsd | 2 +- .../cflint/TestCFBugs_TooManyFunctions.java | 95 --- .../java/com/cflint/TestCFBugs_VarScoper.java | 26 +- src/test/java/com/cflint/TestJSONOutput.java | 6 +- .../com/cflint/integration/TestFiles.java | 4 +- .../integration/TestIntegrationFolder.java | 12 +- .../com/cflint/tools/TestCFMLTagInfo.java | 43 ++ .../cflint/integration/output.expected.json | 2 +- .../output.rulegroup.expected.json | 2 +- .../integration/output_194.expected.json | 2 +- .../mixedScopeExample.expected.txt | 2 +- .../isDate1.expected.txt | 2 +- .../isDate2.expected.txt | 2 +- .../CFIncludeChecker/cfinclude1.expected.txt | 2 +- .../lonelyCfinclude.expected.txt | 2 +- .../Compare1.expected.txt | 2 +- .../Compare2.expected.txt | 2 +- .../tests/Complexity/ifelse.expected.txt | 2 +- .../Complexity/ifelseComplex.expected.txt | 2 +- .../ComponentNameChecker/foo.expected.txt | 2 +- .../ComponentNameChecker/foofoo.expected.txt | 2 +- .../cflint/tests/EmptyFile/foo.expected.txt | 2 +- .../cflint/tests/EmptyFile/fooWS.expected.txt | 2 +- .../tests/ExcludesAll/someErrors.expected.txt | 2 +- .../Any/functionany1.expected.txt | 2 +- .../Any/functionmissing1.expected.txt | 2 +- .../GlobalVarChecker/cfcatch_tag.expected.txt | 2 +- .../Hints/arg_hints_missing.expected.txt | 2 +- .../cflint/tests/Hints/hints1.expected.txt | 2 +- .../Hints/hints2_hintattribute.expected.txt | 2 +- .../Hints/hints3_hintannotation.expected.txt | 2 +- .../Hints/hints4_emptycomment.expected.txt | 2 +- .../tests/Hints/hints5_comment.expected.txt | 2 +- .../tests/Ignores/ignoreCFMLAny1.expected.txt | 2 +- .../tests/Ignores/ignoreCFMLAny2.expected.txt | 2 +- .../ignoreCFMLAny3_Nested.expected.txt | 2 +- .../tests/Ignores/ignoreCFMLAny4.expected.txt | 2 +- .../tests/Ignores/ignoreCFMLAny5.expected.txt | 2 +- .../Ignores/ignoreCFMLComponent.expected.txt | 2 +- .../Ignores/ignoreCFMLComponent2.expected.txt | 2 +- .../Ignores/ignoreCFMLFunction.expected.txt | 2 +- .../tests/Ignores/ignoreLine1.expected.txt | 2 +- .../Ignores/ignoreLineMessage1.expected.txt | 2 +- .../ignoreLineMessageUnmatched.expected.txt | 2 +- .../Ignores/ignoreMultiLine.expected.txt | 2 +- .../Ignores/ignoreMultiLine2.expected.txt | 2 +- .../ignoreMultiLineComponent.expected.txt | 2 +- .../ignoreMultiLineComponent2.expected.txt | 2 +- .../cflint/tests/Includes/Header.expected.txt | 2 +- .../tests/Includes/Template.expected.txt | 2 +- .../literal_arraysort.expected.txt | 2 +- .../literal_checker_326.expected.txt | 2 +- .../missingSemis1.expected.txt | 2 +- .../nameEndsInNumberScript.expected.txt | 2 +- .../cflint/tests/Naming/tempVar.expected.txt | 2 +- .../PackageCase/packagecase_nok.expected.txt | 2 +- .../PackageCase/packagecase_nokC.expected.txt | 2 +- .../packagecase_nok_b.expected.txt | 2 +- .../PackageCase/packagecase_ok.expected.txt | 2 +- .../tests/ParseError/cfloop_359.expected.txt | 2 +- .../ParseError/fileoutput_359.expected.txt | 2 +- .../outside_output_359.expected.txt | 2 +- .../ParseError/singlequote_359.expected.txt | 2 +- .../com/cflint/tests/Parsing/.cflintrc | 7 +- .../tests/Parsing/Underscore.expected.txt | 2 +- .../com/cflint/tests/Parsing/import_359.cfc | 1 + .../tests/Parsing/import_359.expected.txt | 11 + .../com/cflint/tests/Parsing/npe_408.cfc | 8 + .../cflint/tests/Parsing/npe_408.expected.txt | 33 + .../tests/Parsing/parsing251.expected.txt | 2 +- .../tests/Parsing/parsing253.expected.txt | 2 +- .../com/cflint/tests/Parsing/parsing_346.cfc | 2 + .../tests/Parsing/parsing_346.expected.txt | 11 + .../tests/Query/cfquery_param.expected.txt | 2 +- .../tests/Query/cfquery_param2.expected.txt | 2 +- .../tests/Query/cfquery_param3.expected.txt | 2 +- .../Query/cfquery_param_byline.expected.txt | 2 +- .../cfquery_param_byline_nest.expected.txt | 2 +- .../cflint/tests/Query/cfquery_param_case.cfc | 11 + .../Query/cfquery_param_case.expected.txt | 33 + .../tests/TooManyFunctionsChecker/.cflintrc | 9 + .../StructKeyQuoted/.cflintrc | 0 .../StructKeyQuoted/quotedStructKey2.cfc | 0 .../quotedStructKey2.expected.txt | 2 +- .../StructKeyQuoted/unquotedStructKey.cfc | 0 .../unquotedStructKey.expected.txt | 4 +- .../unquotedStructKeyNested.cfc | 0 .../unquotedStructKeyNested.expected.txt | 4 +- .../excessive_cfml.cfc | 14 + .../excessive_cfml.expected.txt | 33 + .../excessive_cfml2.cfc | 11 + .../excessive_cfml2.expected.txt | 11 + .../excessive_cfscript.cfc | 14 + .../excessive_cfscript.expected.txt | 33 + .../excessive_cfscript2.cfc | 11 + .../excessive_cfscript2.expected.txt | 11 + .../UnusedArgument_152.expected.txt | 2 +- .../UnusedArgument_152b.expected.txt | 2 +- .../UnusedArgument_227.expected.txt | 2 +- .../UnusedArgument_257.expected.txt | 2 +- .../UnusedArgument_257b.expected.txt | 2 +- .../UnusedArgument_Case_234.expected.txt | 2 +- .../caselessVariable_242.expected.txt | 2 +- .../UnusedVariable/cflog_339.expected.txt | 2 +- .../cfloopname_339.expected.txt | 2 +- .../UnusedVariable/cfquery_339.expected.txt | 2 +- .../cfqueryname_339.expected.txt | 2 +- .../UnusedVariable/cookie_339.expected.txt | 2 +- .../UnusedVariable/forLoop_211.expected.txt | 2 +- .../UnusedVariable/forLoop_227.expected.txt | 2 +- .../UnusedVariable/local_339.expected.txt | 2 +- .../UnusedVariable/location_339.expected.txt | 2 +- .../UnusedVariable/loop_list_339.expected.txt | 2 +- .../UnusedVariable/simpleUnused.expected.txt | 2 +- .../tests/VarScoper/cfloop_index_413.cfc | 6 + .../VarScoper/cfloop_index_413.expected.txt | 49 ++ .../VarScoper/cfquery_scoper.expected.txt | 2 +- .../cflint/tests/VarScoper/cftry.expected.txt | 2 +- .../com/cflint/tests/VarScoper/for_each.cfc | 7 + .../tests/VarScoper/for_each.expected.txt | 33 + .../tests/VarScoper/local_256.expected.txt | 2 +- .../tests/VarScoper/namedArgs.expected.txt | 2 +- .../tests/VarScoper/property_246.expected.txt | 2 +- .../tests/VarScoper/pureScript.expected.txt | 2 +- .../VarScoper/scriptSample186.expected.txt | 2 +- .../VarScoper/structassignment.expected.txt | 2 +- .../VarScoper/structureKeys_197.expected.txt | 2 +- .../VarScoper/structure_keys_197.expected.txt | 2 +- .../tests/VarScoper/testParse.expected.txt | 2 +- .../VariableNameChecker/cftry.expected.txt | 2 +- .../sample1_228.expected.txt | 2 +- .../sample_239.expected.txt | 2 +- .../WriteDumpChecker/writeDump.expected.txt | 2 +- 154 files changed, 1246 insertions(+), 867 deletions(-) create mode 100644 .editorconfig create mode 100644 src/main/java/com/cflint/tools/CFMLTagInfo.java create mode 100644 src/main/resources/changelog.mustache delete mode 100644 src/test/java/com/cflint/TestCFBugs_TooManyFunctions.java create mode 100644 src/test/java/com/cflint/tools/TestCFMLTagInfo.java create mode 100644 src/test/resources/com/cflint/tests/Parsing/import_359.cfc create mode 100644 src/test/resources/com/cflint/tests/Parsing/import_359.expected.txt create mode 100644 src/test/resources/com/cflint/tests/Parsing/npe_408.cfc create mode 100644 src/test/resources/com/cflint/tests/Parsing/npe_408.expected.txt create mode 100644 src/test/resources/com/cflint/tests/Parsing/parsing_346.cfc create mode 100644 src/test/resources/com/cflint/tests/Parsing/parsing_346.expected.txt create mode 100644 src/test/resources/com/cflint/tests/Query/cfquery_param_case.cfc create mode 100644 src/test/resources/com/cflint/tests/Query/cfquery_param_case.expected.txt create mode 100644 src/test/resources/com/cflint/tests/TooManyFunctionsChecker/.cflintrc rename src/test/resources/com/cflint/tests/{ => TooManyFunctionsChecker}/StructKeyQuoted/.cflintrc (100%) rename src/test/resources/com/cflint/tests/{ => TooManyFunctionsChecker}/StructKeyQuoted/quotedStructKey2.cfc (100%) rename src/test/resources/com/cflint/tests/{ => TooManyFunctionsChecker}/StructKeyQuoted/quotedStructKey2.expected.txt (83%) rename src/test/resources/com/cflint/tests/{ => TooManyFunctionsChecker}/StructKeyQuoted/unquotedStructKey.cfc (100%) rename src/test/resources/com/cflint/tests/{ => TooManyFunctionsChecker}/StructKeyQuoted/unquotedStructKey.expected.txt (84%) rename src/test/resources/com/cflint/tests/{ => TooManyFunctionsChecker}/StructKeyQuoted/unquotedStructKeyNested.cfc (100%) rename src/test/resources/com/cflint/tests/{ => TooManyFunctionsChecker}/StructKeyQuoted/unquotedStructKeyNested.expected.txt (84%) create mode 100644 src/test/resources/com/cflint/tests/TooManyFunctionsChecker/excessive_cfml.cfc create mode 100644 src/test/resources/com/cflint/tests/TooManyFunctionsChecker/excessive_cfml.expected.txt create mode 100644 src/test/resources/com/cflint/tests/TooManyFunctionsChecker/excessive_cfml2.cfc create mode 100644 src/test/resources/com/cflint/tests/TooManyFunctionsChecker/excessive_cfml2.expected.txt create mode 100644 src/test/resources/com/cflint/tests/TooManyFunctionsChecker/excessive_cfscript.cfc create mode 100644 src/test/resources/com/cflint/tests/TooManyFunctionsChecker/excessive_cfscript.expected.txt create mode 100644 src/test/resources/com/cflint/tests/TooManyFunctionsChecker/excessive_cfscript2.cfc create mode 100644 src/test/resources/com/cflint/tests/TooManyFunctionsChecker/excessive_cfscript2.expected.txt create mode 100644 src/test/resources/com/cflint/tests/VarScoper/cfloop_index_413.cfc create mode 100644 src/test/resources/com/cflint/tests/VarScoper/cfloop_index_413.expected.txt create mode 100644 src/test/resources/com/cflint/tests/VarScoper/for_each.cfc create mode 100644 src/test/resources/com/cflint/tests/VarScoper/for_each.expected.txt diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000..6c333eed2 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,7 @@ +root = true + +[*] +charset = utf-8 +insert_final_newline = false +indent_style = space +indent_size = 4 diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b7bb6a64..38c6a12f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,26 @@ History - ======= +## Overview of major changes in CFLint 1.2.0 + +### Parsing + +* Numerous fixes for parsing CFML code, update to CFParser 2.4.10 +* Upgrade to ANTLR 4.7 + +### Linting + +* Bugfixes for rule processing +* Added annotation-based ignoring of rules inline in code. +* JSON-based configuration has undergone a few changes and configuration properties have been deprecated. + +### Output + +* Support for -showStats has been removed - scanning statistics are now always produced and displayed/included +* Findbugs XML output now matches the requirements for Findbugs' bugcollection.xsd and has undergone major changes from earlier versions. +* CFLint XML output has some additional attributes for some XML elements in the output structure (no breaking changes) +* JSON output has undergone a rework of the existing data structure to cater for the output of additional information (breaking changes) + ## CFLint1.2.0 ##### GitHub [#152](https://github.com/cflint/CFLint/issues/152) UNUSED_METHOD_ARGUMENT ignores scoped arguments @@ -73,7 +92,6 @@ History ##### GitHub [#363](https://github.com/cflint/CFLint/issues/363) Maven build fails using the ZIP file from GitHub since it needs the `.git` folder ##### GitHub [#366](https://github.com/cflint/CFLint/issues/366) ANTLR Tool version 4.6 mismatch ##### GitHub [#370](https://github.com/cflint/CFLint/pull/370) #323 - Changing JSON structure and changing expected test results -##### No issue ## CFLint-1.0.1 ##### GitHub [#103](https://github.com/cflint/CFLint/issues/103) Enhancement: Enable default config file when parsing similar to other linters ##### GitHub [#114](https://github.com/cflint/CFLint/issues/114) Group and decide which linting rules to include by default. @@ -96,9 +114,7 @@ History ##### GitHub [#247](https://github.com/cflint/CFLint/pull/247) Update SureFire argLine ##### GitHub [#248](https://github.com/cflint/CFLint/issues/248) Component name missing from message for COMPONENT_INVALID_NAME ##### GitHub [#250](https://github.com/cflint/CFLint/issues/250) Analysis tripped up over UTF-8 files with BOM -##### No issue ## CFLint-0.6.1 -##### No issue ## v0.6.0 ##### GitHub [#104](https://github.com/cflint/CFLint/issues/104) Weird messaging for missing semicolon ##### GitHub [#105](https://github.com/cflint/CFLint/issues/105) Warnings for non-existing errors and non-lint errors before output. @@ -106,14 +122,12 @@ History ##### GitHub [#67](https://github.com/cflint/CFLint/issues/67) Gradle Install ##### GitHub [#80](https://github.com/cflint/CFLint/issues/80) Gradle Deployment ##### GitHub [#95](https://github.com/cflint/CFLint/issues/95) support json config instead of xml -##### No issue ## CFLint0.5.1 ##### GitHub [#65](https://github.com/cflint/CFLint/issues/65) Problem with dynamic table and field names ##### GitHub [#66](https://github.com/cflint/CFLint/issues/66) cflint-disable / cflint-enable ? ##### GitHub [#71](https://github.com/cflint/CFLint/issues/71) Unable to exclude rules ##### GitHub [#89](https://github.com/cflint/CFLint/pull/89) Rule to check for writeDump in cfset tags and script blocks ##### GitHub [#97](https://github.com/cflint/CFLint/issues/97) Release 0.5.1-SNAPSHOT -##### No issue ## v0.5 ##### GitHub [#33](https://github.com/cflint/CFLint/issues/33) no cflint version could be extracted with SublimeLinter ##### GitHub [#35](https://github.com/cflint/CFLint/issues/35) CFLint Should Download Latest Version of CFParser @@ -129,7 +143,6 @@ History ##### GitHub [#60](https://github.com/cflint/CFLint/issues/60) Having trouble using filterFile ##### GitHub [#62](https://github.com/cflint/CFLint/issues/62) JSON output ##### GitHub [#63](https://github.com/cflint/CFLint/issues/63) Release v0.5.0 -##### No issue ## CFLint-0.4-release ##### GitHub [#19](https://github.com/cflint/CFLint/issues/19) Convert bugs.add() to a plugin format. ##### GitHub [#21](https://github.com/cflint/CFLint/issues/21) <cfset/> on multiple lines does not process @@ -139,7 +152,6 @@ History ##### GitHub [#27](https://github.com/cflint/CFLint/issues/27) Maven build fails with error. ##### GitHub [#30](https://github.com/cflint/CFLint/issues/30) NESTED_CFOUTPUT false positive ##### GitHub [#31](https://github.com/cflint/CFLint/issues/31) Trying out the configfile from the command line and getting errors -##### No issue ## CFLint-0.4 ##### No issue ## CFLint-0.3.0 @@ -151,12 +163,10 @@ History ##### GitHub [#6](https://github.com/cflint/CFLint/issues/6) Add -version flag ##### GitHub [#7](https://github.com/cflint/CFLint/issues/7) Add severity level to each issue in stdout ##### GitHub [#8](https://github.com/cflint/CFLint/issues/8) does not support tagless components -##### No issue ## CFLint-0.1.8 ##### No issue ## CFLint-0.1.6 ##### GitHub [#1](https://github.com/cflint/CFLint/issues/1) ignore .cfm~ files -##### No issue ## CFLint-0.1.5 ##### No issue ## CFLint-0.1.4 diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 69e4fa06d..d13f5d692 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -3,7 +3,7 @@ Code of Conduct =============== -###TL;DR +### TL;DR Don't be a dick! ### What we stand for diff --git a/README.md b/README.md index ee7811fa4..d408a97d7 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ A static code analysis tool for CFML. License: [BSD](http://www.opensource.org/licenses/bsd-license.html) -Current Version: 1.2.0 (Jul 29 2017) +Current Version: 1.2.1 (Aug xx 2017) # Versions @@ -49,7 +49,7 @@ If you want to use CFLint from within another Maven project, use: com.github.cflint CFLint - 1.2.0 + 1.2.1 Or always use the latest: @@ -64,19 +64,19 @@ With the binaries retrieved one or the other way, you can now use CFLint on the #### Use the "-all"-version of the jar-file: - CFLint-1.2.0-all.jar + CFLint-1.2.1-all.jar #### Scan a folder with the complete set of rules: - java -jar CFLint-1.2.0-all.jar -folder + java -jar CFLint-1.2.1-all.jar -folder #### Scan a folder with the complete set of rules: - java -jar CFLint-1.2.0-all.jar -file + java -jar CFLint-1.2.1-all.jar -file #### See parameters and help: - java -jar CFLint-1.2.0-all.jar -help + java -jar CFLint-1.2.1-all.jar -help # User manual @@ -127,13 +127,13 @@ An example `.cflintrc` file is shown below: * Please note: `inheritPlugins` and `output` have been marked deprecated in CFLint 1.2.0 and will be removed in 1.3.0. If you are using `.cflintrc` files now, please remove the inheritPlugins and output properties as soon as possible. Plugin inheritance will going forward always be treated as true, the team can not see a use case in which it should be disabled. The value of the output attribute is ignored. -You can find a schema with the deprecated properties excluded [here](/src/main/resources/schemas/.cflintrc.schema.json). +We provide a [schema with the deprecated properties excluded](/src/main/resources/schemas/.cflintrc.schema.json). ### Annotation-based configuration Quite often there are scenarios in which you would generally want to run a certain set of rules against your code but in specific cases need to ignore an otherwise valid violation. -A common example are violations of CFQUERYPARAM_REQ that can't be fixed by applying `` because your DB server doesn't allow `` in a certain position (for instance in a `SELECT TOP #arguments.numberOfRecords# ...` scenario). See [Issue #282](https://github.com/cflint/CFLint/issues/282) for more examples. +A common example are violations of CFQUERYPARAM_REQ that can't be fixed by applying `` because your DB server doesn't allow params in certain positions (for instance in a `SELECT something FROM #application.config.linkedServerName#.DefaultDatabase.dbo.Comment` scenario). See [Issue #282](https://github.com/cflint/CFLint/issues/282) for more examples. CFLint offers an annotation-based configuration to deal with this and similar scenarios. Annotations can be placed on the component- or function-level in a CFC or inline with code. @@ -158,6 +158,7 @@ Multiline ignore annotation: /* @CFLintIgnore SOMETHINGELSE,MISSING_VAR,ANOTHERTHINGTOIGNORE */ + #### Ignoring within SQL: Within SQL, you can also use @@ -166,20 +167,21 @@ Within SQL, you can also use to ignore a rule violation on the next line. -### Precendence of configuration settings +### Precedence of configuration settings Configuration of which plugins are run and which rules are included starts with the global configuration and flows through the command line parameters, folder level rules, and down to the annotations within the source. * global configuration -* custom configuration file (--configfile) -* rule groups (--rulegroups, default behaviour is --rulegroups !Experimental) -* includes/excludes from the command line (--includeRule and --excludeRule) +* custom configuration file (`-configfile`) +* rule groups (`-rulegroups`, default behaviour is --rulegroups !Experimental) +* includes/excludes from the command line (`-includeRule` and `-excludeRule`) * .cflintrc - folder level configuration, mostly for including/excluding specific messages * annotations - explicitly exclude messages in the source code at the tag or line level. The configuration rule that is closest to the rule is the one that takes effect. * If an annotation excludes a message, it will not fire regardless of any configuration above it. -* If you exclude a rule at the command line level, but a .cflintrc adds it back in, it will fire for source files in that part of the source tree. +* If you exclude a rule at the command line level, but a `.cflintrc` adds it back in, it will fire for source files in that part of the source tree. +* If you are passing in multiple parameters at the command line level, in Windows Powershell the parameters must be included in "double quotes", e.g. `-includeRule "MISSING_VAR,CFQUERYPARAM_REQ"` ## Creating reports @@ -189,7 +191,7 @@ CFLint supports a variety of output options that you can control via command-lin The flag `-xml` instructs CFLint to create XML. There are two options for XML reporting. -The first option is what we call CFLint XML. It's an internal format that adheres to a basic schema found [here](/src/main/resources/schemas/cflint-result.xsd). You could then use this format as-is or to do further processing of your choice. +The first option is what we call CFLint XML. It's an internal format that adheres to a basic schema provided [here](/src/main/resources/schemas/cflint-result.xsd). You could then use this format as-is or to do further processing of your choice. The seconds option is FindBugs XML. The resulting XML document adheres to the current version of the FindBugs BugCollection [XML Schema Definition](src/main/resources/findbugs/bugcollection.xsd) and can be used in most CI-/Build-Server products. JetBrains TeamCity 10+ can import this format out of the box. @@ -204,7 +206,7 @@ To create CFLint XML provide the following command-line arguments: Example of CFLint XML: - + ...some more Details...]]> @@ -239,8 +241,8 @@ JSON output can be created with Example of CFLint JSON: { - "version" : "1.2.0", - "timestamp" : "1501202128", + "version" : "1.2.1", + "timestamp" : 1501202128, "issues" : [ { "severity" : "ERROR", "id" : "MISSING_VAR", @@ -317,27 +319,29 @@ Example of plain text output: ## Integration server support -For Jenkins, please look at the Jenkins/Hudson plugin mentioned further below. +For **Jenkins**, please look at the Jenkins/Hudson plugin mentioned further below. -JetBrains' TeamCity has support for FindBugs XML code inspection reports. They can be produced out of the box with CFLint from 1.2.0 onwards (see above in the [FindBugs XML section](#findbugs-xml)). +JetBrains' **TeamCity** has support for FindBugs XML code inspection reports. They can be produced out of the box with CFLint from 1.2.0 onwards (see above in the [FindBugs XML section](#findbugs-xml)). -There is support for SonarQube through StepStone's Sonar ColdFusion plugin mentioned further below. +There is support for **SonarQube** through StepStone's Sonar ColdFusion plugin mentioned further below. There's an NPM wrapper for CFLint below. Please be aware that the wrapper seems to come with its own bundled CFLint binary which might not be up-to-date, which is outside of our control. -Other products in the integration/build server category might work, too. If you're using a specific product that works for you with CFLint please let us know. If you can't get CFLint to work in an environment you use, please let us know as well - we might be able to help. +Other products in the integration/build server category might work, too. If you're using a specific product that works for you with CFLint, please let us know. If you can't get CFLint to work in an environment you use, please let us know as well - we might be able to help. ## IDE support -Currently there is IDE support for Sublime Text through a third-party project (see below). +There are several IDE integrations for CFLint that are available. Below are some brief descriptions, but if you'd like to know more, see [Interesting third-party projects](#interesting-third-party-projects). + +There is IDE support for **Sublime Text 3** through a third-party project utilizing SublimeLinter. -There is also support for Adobe's ColdFusion Builder through a third-party project (see below). Users of CFBuilder, please also see the discussion in issue [#327](https://github.com/cflint/CFLint/issues/327). +There is also support for **Adobe ColdFusion Builder** through a third-party project. Users of CFBuilder, please also see the discussion in [Issue #327](https://github.com/cflint/CFLint/issues/327). -Users of Atom can integrate with AtomLinter through a third-party project (see below). +Users of **Atom** can integrate via AtomLinter through a third-party project. -Support for JetBrains' IntelliJ is planned; talk to [@TheRealAgentK](https://github.com/TheRealAgentK) for more info if you're interested. +An extension for **Visual Studio Code** is also available as a third-party project. -An extension for Visual Studio Code will be released in the near future. +Support for JetBrains' **IntelliJ** is planned; talk to [@TheRealAgentK](https://github.com/TheRealAgentK) for more info if you're interested. ## Extending CFLint @@ -429,7 +433,7 @@ This can be simplified using the default values of a `.cflintrc` file: "inheritParent" : false } -See the discussion in [#290](https://github.com/cflint/CFLint/issues/290) for more info. +See the discussion in [Issue #290](https://github.com/cflint/CFLint/issues/290) for more info. ## Filtering out specific processing results in specific folders @@ -477,27 +481,11 @@ See [CONTRIBUTING.md](/CONTRIBUTING.md) for further information. Please note that the majority of the libraries and projects mentioned here are not directly related to and maintained by the CFLint team. Please see the authors and maintainers of the respective project for support using their libraries first. * [Jenkins/Hudson plugin](https://github.com/jenkinsci/CFLint-plugin) -* [Sublime Text plugin](https://github.com/ckaznocha/SublimeLinter-contrib-CFLint) -* [ColdFusion Builder plugin](https://github.com/cfjedimaster/CFLint-Extension) -* [Atom plugin](https://github.com/ditinc/linter-cflint) -* [Sonar plugin](https://github.com/stepstone-tech/sonar-coldfusion) +* [Sublime Text package](https://github.com/ckaznocha/SublimeLinter-contrib-CFLint) +* [ColdFusion Builder extension](https://github.com/cfjedimaster/CFLint-Extension) +* [Atom package](https://github.com/ditinc/linter-cflint) +* [Visual Studio Code extension](https://github.com/ditinc/linter-cflint) +* [SonarQube plugin](https://github.com/stepstone-tech/sonar-coldfusion) * [NPM wrapper](https://github.com/morgdenn/npm-cflint) * Vim [Syntastic support for CFLint](https://github.com/cflint/cflint-syntastic) - - ----TO DO START - -Get rid of / refactor content... - -Check out the new [wiki!](https://github.com/cflint/CFLint/wiki) where you can: - - - * [Built in Rules](https://github.com/cflint/CFLint/wiki/Built-In-Rules) - * [Learn how to include/exclude rules](https://github.com/cflint/CFLint/wiki/Include-Exclude-Rules-Using-Exteral-XML-File) - * [Learn CFLint from the command line](https://github.com/cflint/CFLint/wiki/How-Do-I-Use-This-Tool%3F) - * [Get the library from Maven](https://github.com/cflint/CFLint/wiki/Get-the-library-from-Maven) - * [Ignore Specific Flags](https://github.com/cflint/CFLint/wiki/Ignoring-Specific-Flags-In-Code) - - ----TO DO END diff --git a/build.gradle b/build.gradle index cf703a9b3..f4ea2812b 100644 --- a/build.gradle +++ b/build.gradle @@ -5,12 +5,15 @@ buildscript { jcenter { url "http://jcenter.bintray.com/" } - maven { url "http://oss.sonatype.org/content/repositories/snapshots/" } + maven { url "http://oss.sonatype.org/content/repositories/snapshots/" + url "https://plugins.gradle.org/m2/" + } } dependencies { classpath 'com.bmuschko:gradle-nexus-plugin:2.3' classpath "io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.5.3" - } + classpath "gradle.plugin.se.bjurr.gitchangelog:git-changelog-gradle-plugin:1.50" + } } plugins { @@ -27,6 +30,8 @@ apply plugin: 'java' apply plugin: 'maven' apply from: 'cobertura.gradle' apply from: 'deploy.gradle' +apply plugin: "se.bjurr.gitchangelog.git-changelog-gradle-plugin" + sourceCompatibility = 1.8 targetCompatibility = 1.8 @@ -34,23 +39,13 @@ targetCompatibility = 1.8 repositories { maven { url "https://oss.sonatype.org/content/repositories/snapshots" } maven { url "http://repo.maven.apache.org/maven2" } + maven { url "https://oss.sonatype.org/content/repositories/releases" } maven { url "http://cfmlprojects.org/artifacts" } } dependencies { - compile group: 'com.github.cfparser', name: 'cfparser', version:'2.4.9' - compile group: 'com.github.cfparser', name: 'cfml.parsing', version:'2.4.9' - compile group: 'com.github.cfparser', name: 'cfml.dictionary', version:'2.4.9' - compile group: 'junit', name: 'junit', version:'4.12' - compile group: 'org.jdom', name: 'jdom', version:'1.1.3' - compile group: 'org.antlr', name: 'antlr4-runtime', version:'4.7' - compile group: 'org.antlr', name: 'stringtemplate', version:'4.0.2' - compile group: 'org.antlr', name: 'antlr4', version:'4.6' - compile group: 'net.htmlparser.jericho', name: 'jericho-html', version:'3.4' - compile group: 'log4j', name: 'log4j', version:'1.2.17' - compile group: 'org.apache.logging.log4j', name: 'log4j-core', version:'2.5' + compile group: 'com.github.cfparser', name: 'cfml.parsing', version:'2.5.0' compile group: 'commons-cli', name: 'commons-cli', version:'1.2' compile group: 'ro.fortsoft.pf4j', name: 'pf4j', version:'0.6' - compile group: 'org.slf4j', name: 'slf4j-log4j12', version:'1.7.5' compile group: 'ant', name: 'ant', version:'1.7.0' compile group: 'com.sun.xml.bind', name: 'jaxb-impl', version:'2.1.8' compile group: 'com.fasterxml.jackson.core', name: 'jackson-core', version:'2.8.6' @@ -61,10 +56,8 @@ dependencies { } // https://mvnrepository.com/artifact/commons-io/commons-io compile group: 'commons-io', name: 'commons-io', version: '2.5' - - runtime group: 'commons-logging', name: 'commons-logging-api', version:'1.1' - runtime group: 'org.slf4j', name: 'slf4j-api', version:'1.7.5' - runtime group: 'org.javolution', name: 'javolution', version:'5.2.6' + + testCompile group: 'junit', name: 'junit', version:'4.12' } test { @@ -80,6 +73,7 @@ jar { manifest { attributes( 'Main-Class': 'com.cflint.main.CFLintMain', + 'Implementation-Version': version, ) } } @@ -99,4 +93,8 @@ task fatJar(type: Jar) { artifacts { archives fatJar -} \ No newline at end of file +} +task gitChangelogTask(type: se.bjurr.gitchangelog.plugin.gradle.GitChangelogTask) { + file = new File("CHANGELOG.md"); + templateContent = file('src/main/resources/changelog.mustache').getText('UTF-8'); + } \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 95cebcf4e..978a1cc4c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,6 @@ #Tue, 06 Oct 2015 20:08:05 -0600 group=com.github.cflint -version=1.2.0 +version=1.2.1-SNAPSHOT name=CFLint release=false snapshot=false diff --git a/pom.xml b/pom.xml index f3c0b20c8..c024421bc 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 com.github.cflint CFLint - 1.2.0 + 1.2.1-SNAPSHOT jar CFLint @@ -48,6 +48,11 @@ cfmlprojects http://cfmlprojects.org/artifacts + + sonatype + sonatype + https://oss.sonatype.org/content/repositories/releases + @@ -64,7 +69,7 @@ 1.7 1.7 - 2.4.10 + 2.5.0 2.8.6 1.7.21 @@ -143,20 +148,6 @@ - - maven-dependency-plugin - - - process-sources - - copy-dependencies - - - ${targetdirectory} - - - - org.codehaus.mojo appassembler-maven-plugin @@ -197,6 +188,17 @@ + + org.apache.maven.plugins + maven-jar-plugin + + + + true + + + + maven-resources-plugin 2.6 diff --git a/src/main/java/com/cflint/CFLint.java b/src/main/java/com/cflint/CFLint.java index 7e3da62f9..85974fe28 100644 --- a/src/main/java/com/cflint/CFLint.java +++ b/src/main/java/com/cflint/CFLint.java @@ -9,8 +9,11 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; +import java.util.HashMap; import java.util.HashSet; +import java.util.LinkedHashMap; import java.util.List; +import java.util.Map; import java.util.Map.Entry; import java.util.Set; import java.util.Stack; @@ -41,6 +44,7 @@ import com.cflint.plugins.exceptions.DefaultCFLintExceptionListener; import com.cflint.tools.AllowedExtensionsLoader; import com.cflint.tools.CFLintFilter; +import com.cflint.tools.CFMLTagInfo; import com.cflint.tools.CommentReformatting; import com.cflint.tools.FileUtil; import com.cflint.tools.PrecedingCommentReader; @@ -93,6 +97,7 @@ public class CFLint implements IErrorReporter { static final String FILE_ERROR = "FILE_ERROR"; static final String PARSE_ERROR = "PARSE_ERROR"; static final String PLUGIN_ERROR = "PLUGIN_ERROR"; + CFMLTagInfo tagInfo; static final String RESOURCE_BUNDLE_NAME = "com.cflint.cflint"; @@ -134,6 +139,7 @@ public CFLint(final CFLintConfiguration configFile) throws IOException { } allowedExtensions.addAll(AllowedExtensionsLoader.init(RESOURCE_BUNDLE_NAME)); cfmlParser.setErrorReporter(this); + tagInfo = new CFMLTagInfo(); } @Deprecated @@ -165,6 +171,7 @@ public CFLint(final CFLintConfiguration configuration, final CFLintScanner... bu } allowedExtensions.addAll(AllowedExtensionsLoader.init(RESOURCE_BUNDLE_NAME)); cfmlParser.setErrorReporter(this); + tagInfo = new CFMLTagInfo(); } public void scan(final String folderName) { @@ -177,7 +184,7 @@ public void scan(final String folderName) { fireClose(); } - private void setupConfigAncestry(File folder){ + public void setupConfigAncestry(File folder){ Stack configFiles = new Stack(); fileLoop: while(folder != null && folder.exists()){ @@ -346,234 +353,248 @@ public void processStack(final List elements, final String space, final int skipToPosition = 0; private void process(final Element elem, final String space, final Context context) throws ParseException, IOException { - if (skipToPosition > elem.getBegin()) { - return; - }else{ - skipToPosition=0; - } - currentElement = elem; - if (elem.getName().equalsIgnoreCase("cfcomponent")) { - final Context componentContext = context.subContext(elem); - componentContext.setInComponent(true); - componentContext.setComponentName(elem.getAttributeValue("displayname")); - componentContext.setContextType(ContextType.Component); - handler.push("component"); - doStructureStart(elem, componentContext, CFCompDeclStatement.class); - } else if (elem.getName().equalsIgnoreCase("cffunction")) { - final Context functionContext = context.subContext(elem); - functionContext.setFunctionName(elem.getAttributeValue("name")); - functionContext.setContextType(ContextType.Function); - handler.push("function"); - doStructureStart(elem, functionContext, CFFuncDeclStatement.class); - } else if (elem.getName().equalsIgnoreCase("cfloop") && elem.getAttributeValue("query")!=null) { - //Give a cfloop for query its own context and set the column names as variables if they are available - final Context loopContext = context.subContext(elem); - loopContext.setContextType(ContextType.QueryLoop); - handler.push("cfloop"); - - final String qryName = elem.getAttributeValue("query"); - handler.addVariables(handler.getQueryColumns(qryName)); - doStructureStart(elem, loopContext, CFFuncDeclStatement.class); + if (skipToPosition > elem.getBegin()) { + return; + } else { + skipToPosition = 0; } - - if (elem.getName().equalsIgnoreCase("cfset") || elem.getName().equalsIgnoreCase("cfif") - || elem.getName().equalsIgnoreCase("cfelseif") || elem.getName().equalsIgnoreCase("cfreturn")) { - scanElement(elem, context); - final Pattern p = Pattern.compile("<\\w+\\s(.*[^/])/?>", Pattern.MULTILINE | Pattern.DOTALL); - final String expr = elem.getFirstStartTag().toString(); - final Matcher m = p.matcher(expr); - if (m.matches()) { - - // TODO if LUCEE? - // final int uglyNotPos = elem.toString().lastIndexOf("<>"); - // int endPos = elem.getStartTag().getEnd() - 1; - // - // if (uglyNotPos > 0) { - // final int nextPos = elem.toString().indexOf(">", uglyNotPos + - // 2); - // if (nextPos > 0 && nextPos < elem.getEndTag().getBegin()) { - // endPos = nextPos; - // } - // } - - // final String cfscript = - // elem.toString().substring(elem.getName().length() + 1, - // Math.min(endPos,elem.toString().length()-1)); - final String cfscript = m.group(1).trim(); - if(!cfscript.isEmpty()){ + try{ + currentElement = elem; + if (elem.getName().equalsIgnoreCase("cfcomponent")) { + final Context componentContext = context.subContext(elem); + componentContext.setInComponent(true); + componentContext.setComponentName(elem.getAttributeValue("displayname")); + componentContext.setContextType(ContextType.Component); + handler.push("component"); + doStructureStart(elem, componentContext, CFCompDeclStatement.class); + } else if (elem.getName().equalsIgnoreCase("cffunction")) { + final Context functionContext = context.subContext(elem); + functionContext.setFunctionName(elem.getAttributeValue("name")); + functionContext.setContextType(ContextType.Function); + handler.push("function"); + doStructureStart(elem, functionContext, CFFuncDeclStatement.class); + } else if (elem.getName().equalsIgnoreCase("cfloop") && elem.getAttributeValue("query")!=null) { + //Give a cfloop for query its own context and set the column names as variables if they are available + final Context loopContext = context.subContext(elem); + loopContext.setContextType(ContextType.QueryLoop); + handler.push("cfloop"); + + final String qryName = elem.getAttributeValue("query"); + handler.addVariables(handler.getQueryColumns(qryName)); + doStructureStart(elem, loopContext, CFFuncDeclStatement.class); + } + + if (elem.getName().equalsIgnoreCase("cfset") || elem.getName().equalsIgnoreCase("cfif") + || elem.getName().equalsIgnoreCase("cfelseif") || elem.getName().equalsIgnoreCase("cfreturn")) { + scanElement(elem, context); + final Pattern p = Pattern.compile("<\\w+\\s(.*[^/])/?>", Pattern.MULTILINE | Pattern.DOTALL); + final String expr = elem.getFirstStartTag().toString(); + final Matcher m = p.matcher(expr); + if (m.matches()) { + + // TODO if LUCEE? + // final int uglyNotPos = elem.toString().lastIndexOf("<>"); + // int endPos = elem.getStartTag().getEnd() - 1; + // + // if (uglyNotPos > 0) { + // final int nextPos = elem.toString().indexOf(">", uglyNotPos + + // 2); + // if (nextPos > 0 && nextPos < elem.getEndTag().getBegin()) { + // endPos = nextPos; + // } + // } + + // final String cfscript = + // elem.toString().substring(elem.getName().length() + 1, + // Math.min(endPos,elem.toString().length()-1)); + final String cfscript = m.group(1).trim(); + if(!cfscript.isEmpty()){ + try { + final CFExpression expression = cfmlParser.parseCFMLExpression(cfscript, this); + if (expression != null) { + process(expression, elem, context); + } + } catch (final Exception npe) { + printException(npe, elem); + final ContextMessage cm = new ContextMessage("PARSE_ERROR", null,null,context.startLine()); + reportRule(currentElement,null,context,null, cm); + } + } + } + processStack(elem.getChildElements(), space + " ", context); + + } else if (elem.getName().equalsIgnoreCase("cfargument")) { + scanElement(elem, context); + final String name = elem.getAttributeValue("name"); + if (name != null) { + handler.addArgument(name); + } + processStack(elem.getChildElements(), space + " ", context); + } else if (elem.getName().equalsIgnoreCase("cfscript")) { + scanElement(elem, context); + String cfscript =elem.getContent().toString(); + if (elem.getEndTag() == null) { + // Hack to fetch the entire cfscript text, if cfscript is a word in the content somewhere, and causes + // the jericho parser to fail + EndTag nextTag = elem.getSource().getNextEndTag(elem.getBegin()); + while (nextTag != null && !nextTag.getName().equalsIgnoreCase(elem.getName())) { + nextTag = elem.getSource().getNextEndTag(nextTag.getEnd()); + } + if (nextTag.getName().equalsIgnoreCase(elem.getName())) { + cfscript = elem.getSource().subSequence(elem.getStartTag().getEnd(), nextTag.getBegin()) + .toString(); + skipToPosition = nextTag.getEnd(); + } + } + final CFScriptStatement scriptStatement = cfmlParser.parseScript(cfscript); + + final Context subcontext = context.subContext(elem); + process(scriptStatement, subcontext); + processStack(elem.getChildElements(), space + " ", context); + } else if (elem.getName().equalsIgnoreCase("cffunction")) { + final Context functionContext = context.subContext(elem); + functionContext.setFunctionName(elem.getAttributeValue("name")); + functionContext.setContextType(ContextType.Function); + scanElement(elem, functionContext); + processStack(elem.getChildElements(), space + " ", functionContext); + // Process any messages added by downstream parsing. + for (final ContextMessage message : functionContext.getMessages()) { + reportRule(elem, null, functionContext, message.getSource(), message); + } + functionContext.getMessages().clear(); + + for (final CFLintStructureListener structurePlugin : getStructureListeners(extensions)) { try { - final CFExpression expression = cfmlParser.parseCFExpression(cfscript, this); - if (expression != null) { - process(expression, elem, context); + structurePlugin.endFunction(functionContext, bugs); + for (final ContextMessage message : functionContext.getMessages()) { + reportRule(elem, null, functionContext, (CFLintScanner) structurePlugin, message); } - } catch (final Exception npe) { - printException(npe, elem); + functionContext.getMessages().clear(); + } catch (final Exception e) { + printException(e); final ContextMessage cm = new ContextMessage("PARSE_ERROR", null,null,context.startLine()); reportRule(currentElement,null,context,null, cm); } } - } - processStack(elem.getChildElements(), space + " ", context); - - } else if (elem.getName().equalsIgnoreCase("cfargument")) { - scanElement(elem, context); - final String name = elem.getAttributeValue("name"); - if (name != null) { - handler.addArgument(name); - } - processStack(elem.getChildElements(), space + " ", context); - } else if (elem.getName().equalsIgnoreCase("cfscript")) { - scanElement(elem, context); - String cfscript =elem.getContent().toString(); - if (elem.getEndTag() == null) { - // Hack to fetch the entire cfscript text, if cfscript is a word in the content somewhere, and causes - // the jericho parser to fail - EndTag nextTag = elem.getSource().getNextEndTag(elem.getBegin()); - while (nextTag != null && !nextTag.getName().equalsIgnoreCase(elem.getName())) { - nextTag = elem.getSource().getNextEndTag(nextTag.getEnd()); - } - if (nextTag.getName().equalsIgnoreCase(elem.getName())) { - cfscript = elem.getSource().subSequence(elem.getStartTag().getEnd(), nextTag.getBegin()) - .toString(); - skipToPosition = nextTag.getEnd(); - } - } - final CFScriptStatement scriptStatement = cfmlParser.parseScript(cfscript); - - final Context subcontext = context.subContext(elem); - process(scriptStatement, subcontext); - processStack(elem.getChildElements(), space + " ", context); - } else if (elem.getName().equalsIgnoreCase("cffunction")) { - final Context functionContext = context.subContext(elem); - functionContext.setFunctionName(elem.getAttributeValue("name")); - functionContext.setContextType(ContextType.Function); - scanElement(elem, functionContext); - processStack(elem.getChildElements(), space + " ", functionContext); - // Process any messages added by downstream parsing. - for (final ContextMessage message : functionContext.getMessages()) { - reportRule(elem, null, functionContext, message.getSource(), message); - } - functionContext.getMessages().clear(); - - for (final CFLintStructureListener structurePlugin : getStructureListeners(extensions)) { - try { - structurePlugin.endFunction(functionContext, bugs); - for (final ContextMessage message : functionContext.getMessages()) { - reportRule(elem, null, functionContext, (CFLintScanner) structurePlugin, message); + handler.pop(); + } else if (elem.getName().equalsIgnoreCase("cfcomponent")) { + final Context componentContext = context.subContext(elem); + componentContext.setInComponent(true); + componentContext.setComponentName(elem.getAttributeValue("displayname")); + componentContext.setContextType(ContextType.Component); + + scanElement(elem, componentContext); + + processStack(elem.getChildElements(), space + " ", componentContext); + for (final CFLintStructureListener structurePlugin : getStructureListeners(extensions)) { + try { + structurePlugin.endComponent(componentContext, bugs); + for (final ContextMessage message : componentContext.getMessages()) { + reportRule(elem, null, componentContext, (CFLintScanner) structurePlugin, message); + } + componentContext.getMessages().clear(); + } catch (final Exception e) { + printException(e); + final ContextMessage cm = new ContextMessage("PARSE_ERROR", null,null,context.startLine()); + reportRule(currentElement,null,context,null, cm); } - functionContext.getMessages().clear(); - } catch (final Exception e) { - printException(e); - final ContextMessage cm = new ContextMessage("PARSE_ERROR", null,null,context.startLine()); - reportRule(currentElement,null,context,null, cm); } - } - handler.pop(); - } else if (elem.getName().equalsIgnoreCase("cfcomponent")) { - final Context componentContext = context.subContext(elem); - componentContext.setInComponent(true); - componentContext.setComponentName(elem.getAttributeValue("displayname")); - componentContext.setContextType(ContextType.Component); - - scanElement(elem, componentContext); - - processStack(elem.getChildElements(), space + " ", componentContext); - for (final CFLintStructureListener structurePlugin : getStructureListeners(extensions)) { - try { - structurePlugin.endComponent(componentContext, bugs); - for (final ContextMessage message : componentContext.getMessages()) { - reportRule(elem, null, componentContext, (CFLintScanner) structurePlugin, message); - } - componentContext.getMessages().clear(); - } catch (final Exception e) { - printException(e); - final ContextMessage cm = new ContextMessage("PARSE_ERROR", null,null,context.startLine()); - reportRule(currentElement,null,context,null, cm); + handler.pop(); + } else if (elem.getName().equalsIgnoreCase("cfquery")) { + scanElement(elem, context); + for(final Entry expression : unpackTagExpressions(elem).entrySet()){ + if (expression != null) { + process(expression.getValue(), elem, context); + } + } + final List list = elem.getAllElements(); + processStack(list.subList(1, list.size()), space + " ", context); + //Save any columns from the cfquery + final String qryName = elem.getAttributeValue("name"); + if(qryName!=null && qryName.trim().length()>0){ + final String qryText = elem.getTextExtractor().toString().toUpperCase(); + final Matcher m = Pattern.compile(".*SELECT\\s(\\w+(\\s*,\\s*\\w+)+)\\s+FROM\\s+.*").matcher(qryText); + final List cols = new ArrayList(); + if(m.matches()){ + cols.addAll(Arrays.asList(m.group(1).trim().split("\\s*,\\s*"))); + handler.addQueryColumnSet(qryName,cols); + } } - } - handler.pop(); - } else if (elem.getName().equalsIgnoreCase("cfquery")) { - scanElement(elem, context); - for(final CFExpression expression : unpackTagExpressions(elem)){ - if (expression != null) { - process(expression, elem, context); - } - } - final List list = elem.getAllElements(); - processStack(list.subList(1, list.size()), space + " ", context); - //Save any columns from the cfquery - final String qryName = elem.getAttributeValue("name"); - if(qryName!=null && qryName.trim().length()>0){ - final String qryText = elem.getTextExtractor().toString().toUpperCase(); - final Matcher m = Pattern.compile(".*SELECT\\s(\\w+(\\s*,\\s*\\w+)+)\\s+FROM\\s+.*").matcher(qryText); - final List cols = new ArrayList(); - if(m.matches()){ - cols.addAll(Arrays.asList(m.group(1).trim().split("\\s*,\\s*"))); - handler.addQueryColumnSet(qryName,cols); - } - } - } else if (elem.getName().equalsIgnoreCase("cfqueryparam")) { - scanElement(elem, context); - } else if (elem.getName().equalsIgnoreCase("cfinclude")) { - scanElement(elem, context); - final String path = elem.getAttributeValue("template"); - final File include = new File(new File(context.getFilename()).getParentFile(), path); - if (strictInclude || include.exists()){ - if(includeFileStack.contains(include)){ - System.err.println("Terminated a recursive call to include file " + include); - }else{ - includeFileStack.push(include); - process(FileUtil.loadFile(include), context.getFilename()); - includeFileStack.pop(); + } else if (elem.getName().equalsIgnoreCase("cfqueryparam")) { + scanElement(elem, context); + } else if (elem.getName().equalsIgnoreCase("cfinclude")) { + scanElement(elem, context); + final String path = elem.getAttributeValue("template"); + final File include = new File(new File(context.getFilename()).getParentFile(), path); + if (strictInclude || include.exists()){ + if(includeFileStack.contains(include)){ + System.err.println("Terminated a recursive call to include file " + include); + }else{ + includeFileStack.push(include); + process(FileUtil.loadFile(include), context.getFilename()); + includeFileStack.pop(); + } + } + } else if (elem.getName().equalsIgnoreCase("cfloop") && elem.getAttributeValue("query")!=null) { + scanElement(elem, context); + processStack(elem.getChildElements(), space + " ", context); + handler.pop(); + } else { + scanElement(elem, context); + for(final Entry expression : unpackTagExpressions(elem).entrySet()){ + if (expression != null) { + process(expression.getValue(), elem, tagInfo.isAssignmentAttribute(elem,expression.getKey())?context.subContextInAssignment():context); + } } + processStack(elem.getChildElements(), space + " ", context); } - } else if (elem.getName().equalsIgnoreCase("cfloop") && elem.getAttributeValue("query")!=null) { - scanElement(elem, context); - processStack(elem.getChildElements(), space + " ", context); - handler.pop(); - } else { - scanElement(elem, context); - for(final CFExpression expression : unpackTagExpressions(elem)){ - if (expression != null) { - process(expression, elem, context); - } - } - processStack(elem.getChildElements(), space + " ", context); - } - // Process any messages added by downstream parsing. - for (final ContextMessage message : context.getMessages()) { - reportRule(elem, null, context, message.getSource(), message); + // Process any messages added by downstream parsing. + for (final ContextMessage message : context.getMessages()) { + reportRule(elem, null, context, message.getSource(), message); + } + context.getMessages().clear(); + }catch(NullPointerException npe){ + printException(npe); + final ContextMessage cm = new ContextMessage("PARSE_ERROR", null,null,context.startLine()); + reportRule(currentElement,null,context,null, cm); } - context.getMessages().clear(); } - private List unpackTagExpressions(final Element elem) { + private Map unpackTagExpressions(final Element elem) { - final List expressions = new ArrayList(); + //Use LinkedHashMap to preserve the order + final Map expressions = new LinkedHashMap(); if(!elem.getName().toLowerCase().startsWith("cf") || elem.getAttributes()==null){ return expressions; } //Unpack any attributes that have a hash expression for (Attribute attr : elem.getAttributes()) { - if (attr.getValue() != null && attr.getValue().contains("#") && !attr.getValue().startsWith("'") - && !attr.getValue().startsWith("\"")) { + if(tagInfo.isAssignmentAttribute(elem, attr.getName())){ + try{ + final CFExpression exp = cfmlParser.parseCFMLExpression(attr.getValue(), this); + expressions.put(attr.getName().toLowerCase(),exp); + } catch (Exception e2) { + System.err.println("Error in parsing : " + attr.getValue() + " on tag " + elem.getName()); + } + } + else if (detectScript(attr)) { //Try wrapping the expression in single or double quotes for parsing. List literalChar = attr.getValue().contains("'")?Arrays.asList("\"","'"):Arrays.asList("'","\""); try { List errors = new ArrayList(); ANTLRErrorListener errorReporter = new ArrayErrorListener(errors ); - final CFExpression exp = cfmlParser.parseCFExpression(literalChar.get(0) + attr.getValue() + literalChar.get(0), errorReporter); + final CFExpression exp = cfmlParser.parseCFMLExpression(literalChar.get(0) + attr.getValue() + literalChar.get(0), errorReporter); if(errors.size()==0){ - expressions.add(exp); + expressions.put(attr.getName().toLowerCase(),exp); continue; } } catch (Exception e) { } // Try other quotes before reporting a failure try { - final CFExpression exp = cfmlParser.parseCFExpression(literalChar.get(1) + attr.getValue() + literalChar.get(1), this); - expressions.add(exp); + final CFExpression exp = cfmlParser.parseCFMLExpression(literalChar.get(1) + attr.getValue() + literalChar.get(1), this); + expressions.put(attr.getName().toLowerCase(),exp); } catch (Exception e2) { System.err.println("Error in parsing : " + attr.getValue() + " on tag " + elem.getName()); } @@ -582,6 +603,11 @@ private List unpackTagExpressions(final Element elem) { return expressions; } + private boolean detectScript(Attribute attr) { + return attr.getValue() != null && attr.getValue().contains("#") && !attr.getValue().startsWith("'") + && !attr.getValue().startsWith("\""); + } + protected void scanElement(final Element elem, final Context context) { for (final CFLintScanner plugin : extensions) { try { @@ -728,7 +754,9 @@ private void process(final CFScriptStatement expression, Context context) { process(((CFForStatement) expression).getBody(), context); } else if (expression instanceof CFForInStatement) { scanExpression(expression, context, elem); - process(((CFForInStatement) expression).getVariable(), elem, context); + final Context forInitContext = context.subContext(elem); + forInitContext.setInAssignmentExpression(true); + process(((CFForInStatement) expression).getVariable(), elem, forInitContext); process(((CFForInStatement) expression).getStructure(), elem, context); process(((CFForInStatement) expression).getBody(), context); } else if (expression instanceof CFIfStatement) { diff --git a/src/main/java/com/cflint/JSONOutput.java b/src/main/java/com/cflint/JSONOutput.java index 3748af82a..6138ac929 100644 --- a/src/main/java/com/cflint/JSONOutput.java +++ b/src/main/java/com/cflint/JSONOutput.java @@ -38,7 +38,7 @@ public void output(final BugList bugList, final Writer writer, CFLintStats stats // timestamp and version jg.writeStringField("version",Version.getVersion()); - jg.writeStringField("timestamp",Long.toString(stats.getTimestamp())); + jg.writeNumberField("timestamp",stats.getTimestamp()); // start issues array jg.writeFieldName("issues"); diff --git a/src/main/java/com/cflint/Version.java b/src/main/java/com/cflint/Version.java index f147499ff..4ab804234 100644 --- a/src/main/java/com/cflint/Version.java +++ b/src/main/java/com/cflint/Version.java @@ -1,33 +1,17 @@ package com.cflint; -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; +import com.cflint.main.CFLintMain; public class Version { public static String getVersion() { - final InputStream is = Version.class - .getResourceAsStream("/META-INF/maven/com.github.cflint/CFLint/pom.properties"); - try { - final BufferedReader reader = new BufferedReader(new InputStreamReader(is)); - String line = reader.readLine(); - while (line != null && !line.startsWith("version=")) { - line = reader.readLine(); - } - if (line != null) { - return line.replaceAll("version=", ""); - } - } catch (final Exception e) { - try { - if (is != null) { - is.close(); - } - } catch (final IOException e1) { - e1.printStackTrace(); - } + + String version = CFLintMain.class.getPackage().getImplementationVersion(); + if (version != null) { + return version; + } else { + return ""; } - return ""; + } } diff --git a/src/main/java/com/cflint/main/CFLintMain.java b/src/main/java/com/cflint/main/CFLintMain.java index 8792e5884..0516bf60a 100644 --- a/src/main/java/com/cflint/main/CFLintMain.java +++ b/src/main/java/com/cflint/main/CFLintMain.java @@ -444,6 +444,10 @@ private void execute() throws IOException, TransformerException, JAXBException, source.append(System.lineSeparator()); } scanner.close(); + final File starterFile = new File(stdInFile); + if (starterFile.exists() && starterFile.getParentFile().exists()){ + cflint.setupConfigAncestry(starterFile.getParentFile()); + } cflint.process(source.toString(), stdInFile); } for (BugInfo bug : cflint.getBugs()) { diff --git a/src/main/java/com/cflint/plugins/Context.java b/src/main/java/com/cflint/plugins/Context.java index 606f73025..a61ed7639 100644 --- a/src/main/java/com/cflint/plugins/Context.java +++ b/src/main/java/com/cflint/plugins/Context.java @@ -37,7 +37,7 @@ public static enum ContextType { private Context parent = null; private List ignores = new ArrayList(); - public void setInAssignmentExpression(boolean inAssignmentExpression) { + public void setInAssignmentExpression(boolean inAssignmentExpression) { this.inAssignmentExpression = inAssignmentExpression; } @@ -224,6 +224,16 @@ public Context subContext(final Element elem) { isInAssignmentExpression(), callStack, tokens); context2.setInComponent(isInComponent()); context2.parent = this; + context2.componentName=componentName; + return context2; + } + public Context subContextInAssignment() { + final Context context2 = new Context(getFilename(), this.element, getFunctionName(), + isInAssignmentExpression(), callStack, tokens); + context2.setInComponent(isInComponent()); + context2.parent = this; + context2.componentName=componentName; + context2.setInAssignmentExpression(true); return context2; } diff --git a/src/main/java/com/cflint/plugins/core/QueryParamChecker.java b/src/main/java/com/cflint/plugins/core/QueryParamChecker.java index dc006e7fb..c471e3f73 100644 --- a/src/main/java/com/cflint/plugins/core/QueryParamChecker.java +++ b/src/main/java/com/cflint/plugins/core/QueryParamChecker.java @@ -33,11 +33,11 @@ public void expression(final CFExpression expression, final Context context, fin @Override public void element(final Element element, final Context context, final BugList bugs) { if ( - element.getName().equals("cfquery") && !"query".equalsIgnoreCase(element.getAttributeValue("dbtype"))) { + element.getName().equalsIgnoreCase("cfquery") && !"query".equalsIgnoreCase(element.getAttributeValue("dbtype"))) { String content = element.getContent().toString(); //Todo : cfparser/Jericho does not support parsing out the cfqueryparam very well. // the following code will not work when there is a > sign in the expression - content = content.replaceAll("]*>", ""); + content = content.replaceAll("<[cC][fF][qQ][uU][eE][rR][yY][pP][aA][rR][aA][mM][^>]*>", ""); if (content.indexOf("#") > 0) { final List ignoreLines = determineIgnoreLines(element); final Matcher matcher = Pattern.compile("#([^#]+?)#").matcher(content); diff --git a/src/main/java/com/cflint/plugins/core/TooManyFunctionsChecker.java b/src/main/java/com/cflint/plugins/core/TooManyFunctionsChecker.java index aed5db97b..11efb63c1 100644 --- a/src/main/java/com/cflint/plugins/core/TooManyFunctionsChecker.java +++ b/src/main/java/com/cflint/plugins/core/TooManyFunctionsChecker.java @@ -18,9 +18,7 @@ public class TooManyFunctionsChecker extends CFLintScannerAdapter { @Override public void expression(final CFScriptStatement expression, final Context context, final BugList bugs) { - if (expression instanceof CFCompDeclStatement) { - functionCount = 0; - } else if (expression instanceof CFFuncDeclStatement) { + if (expression instanceof CFFuncDeclStatement) { if (!trivalFunction(context.getFunctionName())) { functionCount++; @@ -31,9 +29,7 @@ public void expression(final CFScriptStatement expression, final Context context @Override public void element(final Element element, final Context context, final BugList bugs) { - if (element.getName().equals("cfcomponent")) { - functionCount = 0; - } else if (element.getName().equals("cffunction") && !trivalFunction(context.getFunctionName())) { + if (element.getName().equals("cffunction") && !trivalFunction(context.getFunctionName())) { functionCount++; checkNumberFunctions(functionCount, 1, context, bugs); } @@ -55,10 +51,14 @@ protected void checkNumberFunctions(final int functionCount, final int atLine, f threshold = Integer.parseInt(functionThreshold); } - if (functionCount > threshold) { - context.getParent(ContextType.Component).addUniqueMessage("EXCESSIVE_FUNCTIONS", context.getFilename(), + if (functionCount == threshold+1) { + context.getParent(ContextType.Component).addUniqueMessage("EXCESSIVE_FUNCTIONS", null, this, atLine); } } + + public void startComponent(Context context, BugList bugs) { + functionCount = 0; + } } diff --git a/src/main/java/com/cflint/plugins/core/VarScoper.java b/src/main/java/com/cflint/plugins/core/VarScoper.java index b9e757839..9f3c31d0f 100644 --- a/src/main/java/com/cflint/plugins/core/VarScoper.java +++ b/src/main/java/com/cflint/plugins/core/VarScoper.java @@ -85,18 +85,6 @@ public void element(final Element element, final Context context, final BugList assertVariable(element, context, bugs, element.getAttributeValue(attrName)); } } - if (name.equalsIgnoreCase("cfprocparam")) { - final String typeVar = element.getAttributeValue("type"); - if (typeVar != null && (typeVar.equalsIgnoreCase("out") || typeVar.equalsIgnoreCase("inout"))) { - assertVariable(element, context, bugs, element.getAttributeValue(VARIABLE)); - } - } - if (name.equalsIgnoreCase("cffeed")) { - final String typeVar = element.getAttributeValue("action"); - if (typeVar != null && typeVar.equalsIgnoreCase("read")) { - assertVariable(element, context, bugs, element.getAttributeValue("query")); - } - } } } diff --git a/src/main/java/com/cflint/tools/CFMLTagInfo.java b/src/main/java/com/cflint/tools/CFMLTagInfo.java new file mode 100644 index 000000000..7ff1fe7b9 --- /dev/null +++ b/src/main/java/com/cflint/tools/CFMLTagInfo.java @@ -0,0 +1,44 @@ +package com.cflint.tools; + +import java.util.Map; + +import cfml.dictionary.SyntaxDictionary; +import net.htmlparser.jericho.Element; + +public class CFMLTagInfo { + + + /** + * + * @param elem + * @param attributeName + * @return true when the tag/attribute combination represents a variable assignment. + */ + public boolean isAssignmentAttribute(final Element elem, final String attributeName) { + if(elem != null){ + return isAssignmentAttribute(elem.getName(),attributeName); + } + return false; + } + + /** + * + * @param elementName + * @param attributeName + * @return true when the tag/attribute combination represents a variable assignment. + */ + public boolean isAssignmentAttribute(final String elementName, final String attributeName) { + if(elementName!=null && attributeName != null){ + switch(elementName.toLowerCase()){ + case "cfloop": + return attributeName.equalsIgnoreCase("index"); + case "cffeed": + return attributeName.equalsIgnoreCase("query"); + case "cfprocparam": + return attributeName.equalsIgnoreCase("variable"); + + } + } + return false; + } +} diff --git a/src/main/resources/cflint.definition.json b/src/main/resources/cflint.definition.json index 04c86009d..864a6d520 100644 --- a/src/main/resources/cflint.definition.json +++ b/src/main/resources/cflint.definition.json @@ -416,7 +416,7 @@ "className": "TooManyFunctionsChecker", "message": [ { - "messageText": "Component ${filename} has too many functions. Should be less than ${maximum}.", + "messageText": "Component ${component} has too many functions. Should be fewer than ${maximum}.", "code": "EXCESSIVE_FUNCTIONS", "severity": "WARNING" } diff --git a/src/main/resources/changelog.mustache b/src/main/resources/changelog.mustache new file mode 100644 index 000000000..473e84663 --- /dev/null +++ b/src/main/resources/changelog.mustache @@ -0,0 +1,21 @@ +History + +======= + + +{{#tags}} +## {{name}} {{date}} + {{#issues}} + {{#hasIssue}} + {{#hasLink}} +##### {{name}} [{{issue}}]({{link}}) {{title}} + {{/hasLink}} + {{^hasLink}} +##### {{name}} {{issue}} {{title}} + {{/hasLink}} + {{/hasIssue}} + {{^hasIssue}} +##### {{name}} + {{/hasIssue}} + {{/issues}} +{{/tags}} \ No newline at end of file diff --git a/src/main/resources/findbugs/default.xsl b/src/main/resources/findbugs/default.xsl index a80e7ce73..53d76b140 100644 --- a/src/main/resources/findbugs/default.xsl +++ b/src/main/resources/findbugs/default.xsl @@ -76,7 +76,7 @@ - + @@ -94,10 +94,10 @@ Number - + - - + + tablerow0 tablerow1 @@ -105,13 +105,13 @@ - Warnings - + Warnings + - tablerow0 + tablerow0 tablerow1 @@ -127,15 +127,14 @@

Click on each warning link to see a full description of the issue, and details of how to resolve it.

- + - - - + + - - Warnings - Warnings_ + + Warnings + Warnings_ @@ -177,11 +176,10 @@ -



- +

- In file , + , line diff --git a/src/main/resources/findbugs/plain.xsl b/src/main/resources/findbugs/plain.xsl index da5a9bfd9..79cc9ddc2 100644 --- a/src/main/resources/findbugs/plain.xsl +++ b/src/main/resources/findbugs/plain.xsl @@ -1,6 +1,6 @@ @@ -24,287 +24,285 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --> - - - - - - Warning - Severity - Details - - - - - - - CFLint Report - - - - - - - -

CFLint Report

-

Produced using CFLint ().

-

Project:

- -

Metrics

- - -

Summary

- - - - - - - - - - - - tablerow0 - tablerow1 - - - - - - - - - - - tablerow0 - tablerow1 - - - - - - -
Warning TypeNumber
Warnings
Total
-



- -

Warnings

- -

Click on each warning link to see a full description of the issue, and - details of how to resolve it.

- - - - - - - - - Warnings - Warnings_ - - - -



-

Warning Types

- - - - - - - - - - - - - - - - - - - - - Fatal - Critical - - - Error - Warning - Caution - - - Info - Cosmetic - - Unknown - - - -



- - - - In file , - - - line - - - lines - to - - - - - -

-
-

- - -
- - -

- -



-
- - - - - - -

- - - - - - - - - - - - - - -

None

-



-
- - - - - -

lines of code analyzed, - in files

- - - - - - - - - - - - - - - - - - - - - - - - - - -
MetricTotalDensity*
High Priority Warnings - - - - - - - - -
Medium Priority Warnings - - - - - - - - -
Low Priority Warnings - - - - - - - - -
Total Warnings - - - - - - - - - - -
-

(* Defects per Thousand lines of non-commenting source statements)

-



- -
+ xmlns="http://www.w3.org/1999/xhtml" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + + + + + + Warning + Severity + Details + + + + + + + CFLint Report + + + + + + + +

CFLint Report

+

Produced using CFLint ().

+

Project:

+ +

Metrics

+ + +

Summary

+ + + + + + + + + + + + tablerow0 + tablerow1 + + + + + + + + + + + tablerow0 + tablerow1 + + + + + + +
Warning TypeNumber
Warnings
Total
+



+ +

Warnings

+ +

Click on each warning link to see a full description of the issue, and + details of how to resolve it.

+ + + + + + + + Warnings + Warnings_ + + + +



+

Warning Types

+ + + + + + + + +
+ + + + + + + + + + + + Fatal + Critical + + + Error + Warning + Caution + + + Info + Cosmetic + + Unknown + + + +

+ + + , + + + line + + + lines + to + + + + + +

+
+

+ + +
+ + +

+ +



+
+ + + + + + +

+ + + + + + + + + + + + + + +

None

+



+
+ + + + + +

lines of code analyzed, + in files

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
MetricTotalDensity*
High Priority Warnings + + + + + + + + +
Medium Priority Warnings + + + + + + + + +
Low Priority Warnings + + + + + + + + +
Total Warnings + + + + + + + + + + +
+

(* Defects per Thousand lines of non-commenting source statements)

+



+ +
\ No newline at end of file diff --git a/src/main/resources/schemas/cflint-result.schema.json b/src/main/resources/schemas/cflint-result.schema.json index 261250cfd..846a37423 100644 --- a/src/main/resources/schemas/cflint-result.schema.json +++ b/src/main/resources/schemas/cflint-result.schema.json @@ -12,7 +12,7 @@ "timestamp": { "title": "Timestamp", "description": "A timestamp representing the Unix epoch time when these results were generated", - "type": "string" + "type": "number" }, "issues": { "title": "Issues", diff --git a/src/main/resources/schemas/cflint-result.xsd b/src/main/resources/schemas/cflint-result.xsd index f487dc99d..69a13237c 100644 --- a/src/main/resources/schemas/cflint-result.xsd +++ b/src/main/resources/schemas/cflint-result.xsd @@ -156,7 +156,7 @@ The version of CFLint that products these results - + A timestamp representing the Unix epoch time when these results were generated diff --git a/src/test/java/com/cflint/TestCFBugs_TooManyFunctions.java b/src/test/java/com/cflint/TestCFBugs_TooManyFunctions.java deleted file mode 100644 index 71b8f0ae6..000000000 --- a/src/test/java/com/cflint/TestCFBugs_TooManyFunctions.java +++ /dev/null @@ -1,95 +0,0 @@ -package com.cflint; - -import static org.junit.Assert.assertEquals; - -import java.io.IOException; -import java.util.Collection; -import java.util.List; - -import org.junit.Before; -import org.junit.Test; - -import com.cflint.config.CFLintConfig; - -import cfml.parsing.reporting.ParseException; - -public class TestCFBugs_TooManyFunctions { - - private CFLint cfBugs; - - @Before - public void setUp() throws Exception{ - final com.cflint.config.CFLintConfiguration conf = CFLintConfig.createDefaultLimited("TooManyFunctionsChecker"); - cfBugs = new CFLint(conf); - } - - @Test - public void testSmallNumberTagBased() throws ParseException, IOException { - final String cfcSrc = "\r\n" - + "\r\n" - + "\r\n" - + "\r\n" - + ""; - cfBugs.process(cfcSrc, "test"); - Collection> result = cfBugs.getBugs().getBugList().values(); - assertEquals(0, result.size()); - } - - @Test - public void testSmallNumberScriptBased() throws ParseException, IOException { - final String cfcSrc = "component {\r\n" - + "public void function functionOne() {}\r\n" - + "public void function functionTwo() {}\r\n" - + "public void function functionThree() {}\r\n" - + "}"; - cfBugs.process(cfcSrc, "test"); - Collection> result = cfBugs.getBugs().getBugList().values(); - assertEquals(0, result.size()); - } - - @Test - public void testLargeNumberTagBased() throws ParseException, IOException { - final String cfcSrc = "\r\n" - + "\r\n" - + "\r\n" - + "\r\n" - + "\r\n" - + "\r\n" - + "\r\n" - + "\r\n" - + "\r\n" - + "\r\n" - + "\r\n" - + "\r\n" - + "\r\n" - + ""; - cfBugs.process(cfcSrc, "test"); - final List result = cfBugs.getBugs().getBugList().values().iterator().next(); - assertEquals(1, result.size()); - assertEquals("EXCESSIVE_FUNCTIONS", result.get(0).getMessageCode()); - assertEquals(1, result.get(0).getLine()); - } - - @Test - public void testLargeNumberScriptBased() throws ParseException, IOException { - final String cfcSrc = "component {\r\n" - + "public void function functionOne() {}\r\n" - + "public void function functionTwo() {}\r\n" - + "public void function functionThree() {}\r\n" - + "public void function functionFour() {}\r\n" - + "public void function functionFive() {}\r\n" - + "public void function functionSix() {}\r\n" - + "public void function functionSeven() {}\r\n" - + "public void function functionEight() {}\r\n" - + "public void function functionNine() {}\r\n" - + "public void function functionTen() {}\r\n" - + "public void function functionEleven() {}\r\n" - + "}"; - cfBugs.process(cfcSrc, "test"); - final List result = cfBugs.getBugs().getBugList().values().iterator().next(); - assertEquals(1, result.size()); - assertEquals("EXCESSIVE_FUNCTIONS", result.get(0).getMessageCode()); - assertEquals(1, result.get(0).getLine()); - } - -} diff --git a/src/test/java/com/cflint/TestCFBugs_VarScoper.java b/src/test/java/com/cflint/TestCFBugs_VarScoper.java index 808925e9b..0cc56681a 100644 --- a/src/test/java/com/cflint/TestCFBugs_VarScoper.java +++ b/src/test/java/com/cflint/TestCFBugs_VarScoper.java @@ -75,19 +75,19 @@ public void testCFProcParam_InOut() throws ParseException, IOException{ assertEquals(5,result.get(0).getLine()); } - @Test - public void testCFProcParam_In() throws ParseException, IOException{ - final String cfcSrc = "\r\n" + - "\r\n" + - " \r\n" + - " \r\n" + - " \r\n" + - " \r\n" + - "\r\n" + - ""; - cfBugs.process(cfcSrc,"test"); - assertEquals(0,cfBugs.getBugs().getBugList().size()); - } +// @Test +// public void testCFProcParam_In() throws ParseException, IOException{ +// final String cfcSrc = "\r\n" + +// "\r\n" + +// " \r\n" + +// " \r\n" + +// " \r\n" + +// " \r\n" + +// "\r\n" + +// ""; +// cfBugs.process(cfcSrc,"test"); +// assertEquals(0,cfBugs.getBugs().getBugList().size()); +// } @Test public void testCFFeed_Read_Vard() throws ParseException, IOException{ diff --git a/src/test/java/com/cflint/TestJSONOutput.java b/src/test/java/com/cflint/TestJSONOutput.java index e5b4e14e9..9885310a0 100644 --- a/src/test/java/com/cflint/TestJSONOutput.java +++ b/src/test/java/com/cflint/TestJSONOutput.java @@ -30,7 +30,7 @@ public void testOutput() throws IOException { bugList.add(bugInfo); CFLintStats stats = new CFLintStats(123456L,1,new BigInteger("545454")); outputer.output(bugList, writer, stats); - String expectedText = "{\"version\":\"\",\"timestamp\":\"123456\",\"issues\":[{\"severity\":\"\",\"id\":\"PARSE_ERROR\",\"message\":\"PARSE_ERROR\",\"category\":\"CFLINT\",\"abbrev\":\"PE\",\"locations\":[{\"file\":\"c:\\\\temp\\\\test.cfc\",\"fileName\":\"test.cfc\",\"function\":\"testf\",\"column\":1,\"line\":1,\"message\":\"\",\"variable\":\"\",\"expression\":\"\"}]}],\"counts\":{\"totalFiles\":1,\"totalLines\":545454,\"countByCode\":[],\"countBySeverity\":[]}}"; + String expectedText = "{\"version\":\"\",\"timestamp\":123456,\"issues\":[{\"severity\":\"\",\"id\":\"PARSE_ERROR\",\"message\":\"PARSE_ERROR\",\"category\":\"CFLINT\",\"abbrev\":\"PE\",\"locations\":[{\"file\":\"c:\\\\temp\\\\test.cfc\",\"fileName\":\"test.cfc\",\"function\":\"testf\",\"column\":1,\"line\":1,\"message\":\"\",\"variable\":\"\",\"expression\":\"\"}]}],\"counts\":{\"totalFiles\":1,\"totalLines\":545454,\"countByCode\":[],\"countBySeverity\":[]}}"; assertEquals(expectedText,writer.toString()); } @@ -43,7 +43,7 @@ public void testStats() throws IOException { counts.add("PARSE_ERROR", null); CFLintStats stats = new CFLintStats(123456L,1,new BigInteger("545454"),counts); outputer.output(bugList, writer, stats); - String expectedText = "{\"version\":\"\",\"timestamp\":\"123456\",\"issues\":[{\"severity\":\"\",\"id\":\"PARSE_ERROR\",\"message\":\"PARSE_ERROR\",\"category\":\"CFLINT\",\"abbrev\":\"PE\",\"locations\":[{\"file\":\"c:\\\\temp\\\\test.cfc\",\"fileName\":\"test.cfc\",\"function\":\"testf\",\"column\":1,\"line\":1,\"message\":\"\",\"variable\":\"\",\"expression\":\"\"}]}],\"counts\":{\"totalFiles\":1,\"totalLines\":545454,\"countByCode\":[{\"code\":\"PARSE_ERROR\",\"count\":1}],\"countBySeverity\":[]}}"; + String expectedText = "{\"version\":\"\",\"timestamp\":123456,\"issues\":[{\"severity\":\"\",\"id\":\"PARSE_ERROR\",\"message\":\"PARSE_ERROR\",\"category\":\"CFLINT\",\"abbrev\":\"PE\",\"locations\":[{\"file\":\"c:\\\\temp\\\\test.cfc\",\"fileName\":\"test.cfc\",\"function\":\"testf\",\"column\":1,\"line\":1,\"message\":\"\",\"variable\":\"\",\"expression\":\"\"}]}],\"counts\":{\"totalFiles\":1,\"totalLines\":545454,\"countByCode\":[{\"code\":\"PARSE_ERROR\",\"count\":1}],\"countBySeverity\":[]}}"; assertEquals(expectedText,writer.toString()); } @@ -56,7 +56,7 @@ public void testStatsWithSeverity() throws IOException { counts.add("PARSE_ERROR", "ERROR"); CFLintStats stats = new CFLintStats(123456L,1,new BigInteger("545454"),counts); outputer.output(bugList, writer, stats); - String expectedText = "{\"version\":\"\",\"timestamp\":\"123456\",\"issues\":[{\"severity\":\"ERROR\",\"id\":\"PARSE_ERROR\",\"message\":\"PARSE_ERROR\",\"category\":\"CFLINT\",\"abbrev\":\"PE\",\"locations\":[{\"file\":\"c:\\\\temp\\\\test.cfc\",\"fileName\":\"test.cfc\",\"function\":\"testf\",\"column\":1,\"line\":1,\"message\":\"\",\"variable\":\"\",\"expression\":\"\"}]}],\"counts\":{\"totalFiles\":1,\"totalLines\":545454,\"countByCode\":[{\"code\":\"PARSE_ERROR\",\"count\":1}],\"countBySeverity\":[{\"severity\":\"ERROR\",\"count\":1}]}}"; + String expectedText = "{\"version\":\"\",\"timestamp\":123456,\"issues\":[{\"severity\":\"ERROR\",\"id\":\"PARSE_ERROR\",\"message\":\"PARSE_ERROR\",\"category\":\"CFLINT\",\"abbrev\":\"PE\",\"locations\":[{\"file\":\"c:\\\\temp\\\\test.cfc\",\"fileName\":\"test.cfc\",\"function\":\"testf\",\"column\":1,\"line\":1,\"message\":\"\",\"variable\":\"\",\"expression\":\"\"}]}],\"counts\":{\"totalFiles\":1,\"totalLines\":545454,\"countByCode\":[{\"code\":\"PARSE_ERROR\",\"count\":1}],\"countBySeverity\":[{\"severity\":\"ERROR\",\"count\":1}]}}"; assertEquals(expectedText,writer.toString()); } diff --git a/src/test/java/com/cflint/integration/TestFiles.java b/src/test/java/com/cflint/integration/TestFiles.java index b4fb49490..c957f3a51 100644 --- a/src/test/java/com/cflint/integration/TestFiles.java +++ b/src/test/java/com/cflint/integration/TestFiles.java @@ -113,8 +113,8 @@ public void exceptionOccurred(Throwable exception, String messageCode, String fi writeExpectFile(expectedFile, actualTree); } assertEquals( - expectedText.replaceAll("\\\\","/").replaceAll("/+","/").replaceAll("\r\n", "\n").replaceAll("\"timestamp\" : \"\\d+\"", "\"timestamp\" : \"0\""), - actualTree.replaceAll("\\\\","/").replaceAll("/+","/").replaceAll("\r\n", "\n").replaceAll("\"timestamp\" : \"\\d+\"", "\"timestamp\" : \"0\"")); + expectedText.replaceAll("\\\\","/").replaceAll("/+","/").replaceAll("\r\n", "\n").replaceAll("\"timestamp\" : \\d+", "\"timestamp\" : 0"), + actualTree.replaceAll("\\\\","/").replaceAll("/+","/").replaceAll("\r\n", "\n").replaceAll("\"timestamp\" : \\d+", "\"timestamp\" : 0")); } } diff --git a/src/test/java/com/cflint/integration/TestIntegrationFolder.java b/src/test/java/com/cflint/integration/TestIntegrationFolder.java index 7c4716cb4..b917c5bd4 100644 --- a/src/test/java/com/cflint/integration/TestIntegrationFolder.java +++ b/src/test/java/com/cflint/integration/TestIntegrationFolder.java @@ -25,8 +25,8 @@ public void testFolder() throws Exception{ }); final String expected = loadFile(new File("src/test/resources/com/cflint/integration/output.expected.json")); final String actual = loadFile(new File("src/test/resources/com/cflint/integration/output.json")); - assertEquals(expected.replaceAll("\\\\","/").replaceAll("/+","/").replaceAll("\\R", "\n").replaceAll("\"file\".+\\R\\s*", "").replaceAll("\"timestamp\" : \"\\d+\"", "\"timestamp\" : \"0\""), - actual.replaceAll("\\\\","/").replaceAll("/+","/").replaceAll("\\R", "\n").replaceAll("\"file\".+\\R\\s*", "").replaceAll("\"timestamp\" : \"\\d+\"", "\"timestamp\" : \"0\"")); + assertEquals(expected.replaceAll("\\\\","/").replaceAll("/+","/").replaceAll("\\R", "\n").replaceAll("\"file\".+\\R\\s*", "").replaceAll("\"timestamp\" : \\d+", "\"timestamp\" : 0"), + actual.replaceAll("\\\\","/").replaceAll("/+","/").replaceAll("\\R", "\n").replaceAll("\"file\".+\\R\\s*", "").replaceAll("\"timestamp\" : \\d+", "\"timestamp\" : 0")); } @Test @@ -43,8 +43,8 @@ public void testRuleGroupFolder() throws Exception{ }); final String expected = loadFile(new File("src/test/resources/com/cflint/integration/output.rulegroup.expected.json")); final String actual = loadFile(new File("src/test/resources/com/cflint/integration/output.rulegroup.json")); - assertEquals(expected.replaceAll("\\\\","/").replaceAll("/+","/").replaceAll("\\R", "\n").replaceAll("\"file\".+\\R\\s*", "").replaceAll("\"timestamp\" : \"\\d+\"", "\"timestamp\" : \"0\""), - actual.replaceAll("\\\\","/").replaceAll("/+","/").replaceAll("\\R", "\n").replaceAll("\"file\".+\\R\\s*", "").replaceAll("\"timestamp\" : \"\\d+\"", "\"timestamp\" : \"0\"")); + assertEquals(expected.replaceAll("\\\\","/").replaceAll("/+","/").replaceAll("\\R", "\n").replaceAll("\"file\".+\\R\\s*", "").replaceAll("\"timestamp\" : \\d+", "\"timestamp\" : 0"), + actual.replaceAll("\\\\","/").replaceAll("/+","/").replaceAll("\\R", "\n").replaceAll("\"file\".+\\R\\s*", "").replaceAll("\"timestamp\" : \\d+", "\"timestamp\" : 0")); } @@ -65,8 +65,8 @@ public void test_194() throws Exception{ final String expected = loadFile(new File("src/test/resources/com/cflint/integration/output_194.expected.json")); final String actual = loadFile(tempFile); tempFile.delete(); - assertEquals(expected.replaceAll("\\\\","/").replaceAll("/+","/").replaceAll("\\R", "\n").replaceAll("\"file\".+\\R\\s*", "").replaceAll("\"timestamp\" : \"\\d+\"", "\"timestamp\" : \"0\""), - actual.replaceAll("\\\\","/").replaceAll("/+","/").replaceAll("\\R", "\n").replaceAll("\"file\".+\\R\\s*", "").replaceAll("\"timestamp\" : \"\\d+\"", "\"timestamp\" : \"0\"")); + assertEquals(expected.replaceAll("\\\\","/").replaceAll("/+","/").replaceAll("\\R", "\n").replaceAll("\"file\".+\\R\\s*", "").replaceAll("\"timestamp\" : \\d+", "\"timestamp\" : 0"), + actual.replaceAll("\\\\","/").replaceAll("/+","/").replaceAll("\\R", "\n").replaceAll("\"file\".+\\R\\s*", "").replaceAll("\"timestamp\" : \\d+", "\"timestamp\" : 0")); } public static String loadFile(File file) throws IOException { InputStream is = new FileInputStream(file); diff --git a/src/test/java/com/cflint/tools/TestCFMLTagInfo.java b/src/test/java/com/cflint/tools/TestCFMLTagInfo.java new file mode 100644 index 000000000..edaec88bd --- /dev/null +++ b/src/test/java/com/cflint/tools/TestCFMLTagInfo.java @@ -0,0 +1,43 @@ +package com.cflint.tools; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +import java.io.IOException; + +import javax.xml.bind.JAXBException; + +import org.junit.Before; +import org.junit.Test; + +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.databind.JsonMappingException; + +public class TestCFMLTagInfo { + + private CFMLTagInfo tagInfo; + @Before + public void setUp() throws JsonParseException, JsonMappingException, IOException{ + tagInfo = new CFMLTagInfo(); + } + @Test + public void testCffeedAction(){ + assertTrue(tagInfo.isAssignmentAttribute("cffeed", "query")); + } + @Test + public void testCfloopIndex(){ + assertTrue(tagInfo.isAssignmentAttribute("cfloop", "index")); + } + @Test + public void testCfloopIndexCase(){ + assertTrue(tagInfo.isAssignmentAttribute("CFloop", "Index")); + } + @Test + public void testCfloopBar(){ + assertFalse(tagInfo.isAssignmentAttribute("cfloop", "bar")); + } + @Test + public void testFooBar(){ + assertFalse(tagInfo.isAssignmentAttribute("foo", "bar")); + } +} diff --git a/src/test/resources/com/cflint/integration/output.expected.json b/src/test/resources/com/cflint/integration/output.expected.json index 5abdabf53..70bd0901f 100644 --- a/src/test/resources/com/cflint/integration/output.expected.json +++ b/src/test/resources/com/cflint/integration/output.expected.json @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "0", + "timestamp" : 0, "issues" : [ { "severity" : "INFO", "id" : "COMPONENT_INVALID_NAME", diff --git a/src/test/resources/com/cflint/integration/output.rulegroup.expected.json b/src/test/resources/com/cflint/integration/output.rulegroup.expected.json index da7564888..0dba955a7 100644 --- a/src/test/resources/com/cflint/integration/output.rulegroup.expected.json +++ b/src/test/resources/com/cflint/integration/output.rulegroup.expected.json @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "0", + "timestamp" : 0, "issues" : [ { "severity" : "INFO", "id" : "COMPONENT_INVALID_NAME", diff --git a/src/test/resources/com/cflint/integration/output_194.expected.json b/src/test/resources/com/cflint/integration/output_194.expected.json index da7564888..0dba955a7 100644 --- a/src/test/resources/com/cflint/integration/output_194.expected.json +++ b/src/test/resources/com/cflint/integration/output_194.expected.json @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "0", + "timestamp" : 0, "issues" : [ { "severity" : "INFO", "id" : "COMPONENT_INVALID_NAME", diff --git a/src/test/resources/com/cflint/tests/ArgVarConflict/mixedScopeExample.expected.txt b/src/test/resources/com/cflint/tests/ArgVarConflict/mixedScopeExample.expected.txt index 54ac751ba..eb3377c76 100644 --- a/src/test/resources/com/cflint/tests/ArgVarConflict/mixedScopeExample.expected.txt +++ b/src/test/resources/com/cflint/tests/ArgVarConflict/mixedScopeExample.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202121", + "timestamp" : 1501392714, "issues" : [ ], "counts" : { "totalFiles" : 0, diff --git a/src/test/resources/com/cflint/tests/BuiltInFunctionChecker/isDate1.expected.txt b/src/test/resources/com/cflint/tests/BuiltInFunctionChecker/isDate1.expected.txt index 79533d732..c40af268e 100644 --- a/src/test/resources/com/cflint/tests/BuiltInFunctionChecker/isDate1.expected.txt +++ b/src/test/resources/com/cflint/tests/BuiltInFunctionChecker/isDate1.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202123", + "timestamp" : 1501392717, "issues" : [ { "severity" : "WARNING", "id" : "AVOID_USING_ISDATE", diff --git a/src/test/resources/com/cflint/tests/BuiltInFunctionChecker/isDate2.expected.txt b/src/test/resources/com/cflint/tests/BuiltInFunctionChecker/isDate2.expected.txt index 57e4abe2d..3cb4ec527 100644 --- a/src/test/resources/com/cflint/tests/BuiltInFunctionChecker/isDate2.expected.txt +++ b/src/test/resources/com/cflint/tests/BuiltInFunctionChecker/isDate2.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202124", + "timestamp" : 1501392718, "issues" : [ { "severity" : "WARNING", "id" : "AVOID_USING_ISDATE", diff --git a/src/test/resources/com/cflint/tests/CFIncludeChecker/cfinclude1.expected.txt b/src/test/resources/com/cflint/tests/CFIncludeChecker/cfinclude1.expected.txt index 8566882d8..cdfb7b5a7 100644 --- a/src/test/resources/com/cflint/tests/CFIncludeChecker/cfinclude1.expected.txt +++ b/src/test/resources/com/cflint/tests/CFIncludeChecker/cfinclude1.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202125", + "timestamp" : 1501392718, "issues" : [ { "severity" : "WARNING", "id" : "AVOID_USING_CFINCLUDE_TAG", diff --git a/src/test/resources/com/cflint/tests/CFIncludeChecker/lonelyCfinclude.expected.txt b/src/test/resources/com/cflint/tests/CFIncludeChecker/lonelyCfinclude.expected.txt index 9464dabe4..2ac98cf59 100644 --- a/src/test/resources/com/cflint/tests/CFIncludeChecker/lonelyCfinclude.expected.txt +++ b/src/test/resources/com/cflint/tests/CFIncludeChecker/lonelyCfinclude.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202125", + "timestamp" : 1501392718, "issues" : [ { "severity" : "WARNING", "id" : "AVOID_USING_CFINCLUDE_TAG", diff --git a/src/test/resources/com/cflint/tests/CompareInsteadOfAssign/Compare1.expected.txt b/src/test/resources/com/cflint/tests/CompareInsteadOfAssign/Compare1.expected.txt index 0b75c728a..bc97b8df7 100644 --- a/src/test/resources/com/cflint/tests/CompareInsteadOfAssign/Compare1.expected.txt +++ b/src/test/resources/com/cflint/tests/CompareInsteadOfAssign/Compare1.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202125", + "timestamp" : 1501392719, "issues" : [ { "severity" : "WARNING", "id" : "COMPARE_INSTEAD_OF_ASSIGN", diff --git a/src/test/resources/com/cflint/tests/CompareInsteadOfAssign/Compare2.expected.txt b/src/test/resources/com/cflint/tests/CompareInsteadOfAssign/Compare2.expected.txt index 467c02092..d4c81b880 100644 --- a/src/test/resources/com/cflint/tests/CompareInsteadOfAssign/Compare2.expected.txt +++ b/src/test/resources/com/cflint/tests/CompareInsteadOfAssign/Compare2.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202125", + "timestamp" : 1501392719, "issues" : [ ], "counts" : { "totalFiles" : 0, diff --git a/src/test/resources/com/cflint/tests/Complexity/ifelse.expected.txt b/src/test/resources/com/cflint/tests/Complexity/ifelse.expected.txt index 467c02092..d4c81b880 100644 --- a/src/test/resources/com/cflint/tests/Complexity/ifelse.expected.txt +++ b/src/test/resources/com/cflint/tests/Complexity/ifelse.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202125", + "timestamp" : 1501392719, "issues" : [ ], "counts" : { "totalFiles" : 0, diff --git a/src/test/resources/com/cflint/tests/Complexity/ifelseComplex.expected.txt b/src/test/resources/com/cflint/tests/Complexity/ifelseComplex.expected.txt index 04c74290b..53963395a 100644 --- a/src/test/resources/com/cflint/tests/Complexity/ifelseComplex.expected.txt +++ b/src/test/resources/com/cflint/tests/Complexity/ifelseComplex.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202126", + "timestamp" : 1501392720, "issues" : [ { "severity" : "WARNING", "id" : "FUNCTION_TOO_COMPLEX", diff --git a/src/test/resources/com/cflint/tests/ComponentNameChecker/foo.expected.txt b/src/test/resources/com/cflint/tests/ComponentNameChecker/foo.expected.txt index e5bbaabb9..c6d79dc77 100644 --- a/src/test/resources/com/cflint/tests/ComponentNameChecker/foo.expected.txt +++ b/src/test/resources/com/cflint/tests/ComponentNameChecker/foo.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202126", + "timestamp" : 1501392720, "issues" : [ { "severity" : "INFO", "id" : "COMPONENT_INVALID_NAME", diff --git a/src/test/resources/com/cflint/tests/ComponentNameChecker/foofoo.expected.txt b/src/test/resources/com/cflint/tests/ComponentNameChecker/foofoo.expected.txt index f8ea5f80b..9c7d6df47 100644 --- a/src/test/resources/com/cflint/tests/ComponentNameChecker/foofoo.expected.txt +++ b/src/test/resources/com/cflint/tests/ComponentNameChecker/foofoo.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202126", + "timestamp" : 1501392720, "issues" : [ { "severity" : "INFO", "id" : "COMPONENT_INVALID_NAME", diff --git a/src/test/resources/com/cflint/tests/EmptyFile/foo.expected.txt b/src/test/resources/com/cflint/tests/EmptyFile/foo.expected.txt index 582364b63..4e6bc4dee 100644 --- a/src/test/resources/com/cflint/tests/EmptyFile/foo.expected.txt +++ b/src/test/resources/com/cflint/tests/EmptyFile/foo.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202126", + "timestamp" : 1501392720, "issues" : [ { "severity" : "WARNING", "id" : "AVOID_EMPTY_FILES", diff --git a/src/test/resources/com/cflint/tests/EmptyFile/fooWS.expected.txt b/src/test/resources/com/cflint/tests/EmptyFile/fooWS.expected.txt index cb88457c8..0c6e1256b 100644 --- a/src/test/resources/com/cflint/tests/EmptyFile/fooWS.expected.txt +++ b/src/test/resources/com/cflint/tests/EmptyFile/fooWS.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202126", + "timestamp" : 1501392720, "issues" : [ { "severity" : "WARNING", "id" : "AVOID_EMPTY_FILES", diff --git a/src/test/resources/com/cflint/tests/ExcludesAll/someErrors.expected.txt b/src/test/resources/com/cflint/tests/ExcludesAll/someErrors.expected.txt index 5fdd01c9c..3842b986f 100644 --- a/src/test/resources/com/cflint/tests/ExcludesAll/someErrors.expected.txt +++ b/src/test/resources/com/cflint/tests/ExcludesAll/someErrors.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202126", + "timestamp" : 1501392720, "issues" : [ ], "counts" : { "totalFiles" : 0, diff --git a/src/test/resources/com/cflint/tests/FunctionType/Any/functionany1.expected.txt b/src/test/resources/com/cflint/tests/FunctionType/Any/functionany1.expected.txt index b44c211d9..bf347a025 100644 --- a/src/test/resources/com/cflint/tests/FunctionType/Any/functionany1.expected.txt +++ b/src/test/resources/com/cflint/tests/FunctionType/Any/functionany1.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202127", + "timestamp" : 1501392721, "issues" : [ { "severity" : "INFO", "id" : "FUNCTION_TYPE_ANY", diff --git a/src/test/resources/com/cflint/tests/FunctionType/Any/functionmissing1.expected.txt b/src/test/resources/com/cflint/tests/FunctionType/Any/functionmissing1.expected.txt index b70d642d0..5bd8de479 100644 --- a/src/test/resources/com/cflint/tests/FunctionType/Any/functionmissing1.expected.txt +++ b/src/test/resources/com/cflint/tests/FunctionType/Any/functionmissing1.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202127", + "timestamp" : 1501392721, "issues" : [ ], "counts" : { "totalFiles" : 0, diff --git a/src/test/resources/com/cflint/tests/GlobalVarChecker/cfcatch_tag.expected.txt b/src/test/resources/com/cflint/tests/GlobalVarChecker/cfcatch_tag.expected.txt index b70d642d0..5bd8de479 100644 --- a/src/test/resources/com/cflint/tests/GlobalVarChecker/cfcatch_tag.expected.txt +++ b/src/test/resources/com/cflint/tests/GlobalVarChecker/cfcatch_tag.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202127", + "timestamp" : 1501392721, "issues" : [ ], "counts" : { "totalFiles" : 0, diff --git a/src/test/resources/com/cflint/tests/Hints/arg_hints_missing.expected.txt b/src/test/resources/com/cflint/tests/Hints/arg_hints_missing.expected.txt index b70d642d0..5bd8de479 100644 --- a/src/test/resources/com/cflint/tests/Hints/arg_hints_missing.expected.txt +++ b/src/test/resources/com/cflint/tests/Hints/arg_hints_missing.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202127", + "timestamp" : 1501392721, "issues" : [ ], "counts" : { "totalFiles" : 0, diff --git a/src/test/resources/com/cflint/tests/Hints/hints1.expected.txt b/src/test/resources/com/cflint/tests/Hints/hints1.expected.txt index 2738f4961..190659b78 100644 --- a/src/test/resources/com/cflint/tests/Hints/hints1.expected.txt +++ b/src/test/resources/com/cflint/tests/Hints/hints1.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202127", + "timestamp" : 1501392721, "issues" : [ { "severity" : "WARNING", "id" : "COMPONENT_HINT_MISSING", diff --git a/src/test/resources/com/cflint/tests/Hints/hints2_hintattribute.expected.txt b/src/test/resources/com/cflint/tests/Hints/hints2_hintattribute.expected.txt index b70d642d0..5bd8de479 100644 --- a/src/test/resources/com/cflint/tests/Hints/hints2_hintattribute.expected.txt +++ b/src/test/resources/com/cflint/tests/Hints/hints2_hintattribute.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202127", + "timestamp" : 1501392721, "issues" : [ ], "counts" : { "totalFiles" : 0, diff --git a/src/test/resources/com/cflint/tests/Hints/hints3_hintannotation.expected.txt b/src/test/resources/com/cflint/tests/Hints/hints3_hintannotation.expected.txt index b70d642d0..94ff880e6 100644 --- a/src/test/resources/com/cflint/tests/Hints/hints3_hintannotation.expected.txt +++ b/src/test/resources/com/cflint/tests/Hints/hints3_hintannotation.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202127", + "timestamp" : 1501392722, "issues" : [ ], "counts" : { "totalFiles" : 0, diff --git a/src/test/resources/com/cflint/tests/Hints/hints4_emptycomment.expected.txt b/src/test/resources/com/cflint/tests/Hints/hints4_emptycomment.expected.txt index 7d35448a2..edc87e2f6 100644 --- a/src/test/resources/com/cflint/tests/Hints/hints4_emptycomment.expected.txt +++ b/src/test/resources/com/cflint/tests/Hints/hints4_emptycomment.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202128", + "timestamp" : 1501392722, "issues" : [ { "severity" : "WARNING", "id" : "COMPONENT_HINT_MISSING", diff --git a/src/test/resources/com/cflint/tests/Hints/hints5_comment.expected.txt b/src/test/resources/com/cflint/tests/Hints/hints5_comment.expected.txt index 4d20c602a..94ff880e6 100644 --- a/src/test/resources/com/cflint/tests/Hints/hints5_comment.expected.txt +++ b/src/test/resources/com/cflint/tests/Hints/hints5_comment.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202128", + "timestamp" : 1501392722, "issues" : [ ], "counts" : { "totalFiles" : 0, diff --git a/src/test/resources/com/cflint/tests/Ignores/ignoreCFMLAny1.expected.txt b/src/test/resources/com/cflint/tests/Ignores/ignoreCFMLAny1.expected.txt index 4d20c602a..94ff880e6 100644 --- a/src/test/resources/com/cflint/tests/Ignores/ignoreCFMLAny1.expected.txt +++ b/src/test/resources/com/cflint/tests/Ignores/ignoreCFMLAny1.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202128", + "timestamp" : 1501392722, "issues" : [ ], "counts" : { "totalFiles" : 0, diff --git a/src/test/resources/com/cflint/tests/Ignores/ignoreCFMLAny2.expected.txt b/src/test/resources/com/cflint/tests/Ignores/ignoreCFMLAny2.expected.txt index c1812dcd9..2591565d6 100644 --- a/src/test/resources/com/cflint/tests/Ignores/ignoreCFMLAny2.expected.txt +++ b/src/test/resources/com/cflint/tests/Ignores/ignoreCFMLAny2.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202128", + "timestamp" : 1501392722, "issues" : [ { "severity" : "ERROR", "id" : "MISSING_VAR", diff --git a/src/test/resources/com/cflint/tests/Ignores/ignoreCFMLAny3_Nested.expected.txt b/src/test/resources/com/cflint/tests/Ignores/ignoreCFMLAny3_Nested.expected.txt index 4d20c602a..94ff880e6 100644 --- a/src/test/resources/com/cflint/tests/Ignores/ignoreCFMLAny3_Nested.expected.txt +++ b/src/test/resources/com/cflint/tests/Ignores/ignoreCFMLAny3_Nested.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202128", + "timestamp" : 1501392722, "issues" : [ ], "counts" : { "totalFiles" : 0, diff --git a/src/test/resources/com/cflint/tests/Ignores/ignoreCFMLAny4.expected.txt b/src/test/resources/com/cflint/tests/Ignores/ignoreCFMLAny4.expected.txt index 4d20c602a..c42dd76b1 100644 --- a/src/test/resources/com/cflint/tests/Ignores/ignoreCFMLAny4.expected.txt +++ b/src/test/resources/com/cflint/tests/Ignores/ignoreCFMLAny4.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202128", + "timestamp" : 1501392723, "issues" : [ ], "counts" : { "totalFiles" : 0, diff --git a/src/test/resources/com/cflint/tests/Ignores/ignoreCFMLAny5.expected.txt b/src/test/resources/com/cflint/tests/Ignores/ignoreCFMLAny5.expected.txt index 4d20c602a..c42dd76b1 100644 --- a/src/test/resources/com/cflint/tests/Ignores/ignoreCFMLAny5.expected.txt +++ b/src/test/resources/com/cflint/tests/Ignores/ignoreCFMLAny5.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202128", + "timestamp" : 1501392723, "issues" : [ ], "counts" : { "totalFiles" : 0, diff --git a/src/test/resources/com/cflint/tests/Ignores/ignoreCFMLComponent.expected.txt b/src/test/resources/com/cflint/tests/Ignores/ignoreCFMLComponent.expected.txt index 1cc5c43ed..e13d0623d 100644 --- a/src/test/resources/com/cflint/tests/Ignores/ignoreCFMLComponent.expected.txt +++ b/src/test/resources/com/cflint/tests/Ignores/ignoreCFMLComponent.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202129", + "timestamp" : 1501392723, "issues" : [ { "severity" : "ERROR", "id" : "MISSING_VAR", diff --git a/src/test/resources/com/cflint/tests/Ignores/ignoreCFMLComponent2.expected.txt b/src/test/resources/com/cflint/tests/Ignores/ignoreCFMLComponent2.expected.txt index 7607703df..c42dd76b1 100644 --- a/src/test/resources/com/cflint/tests/Ignores/ignoreCFMLComponent2.expected.txt +++ b/src/test/resources/com/cflint/tests/Ignores/ignoreCFMLComponent2.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202129", + "timestamp" : 1501392723, "issues" : [ ], "counts" : { "totalFiles" : 0, diff --git a/src/test/resources/com/cflint/tests/Ignores/ignoreCFMLFunction.expected.txt b/src/test/resources/com/cflint/tests/Ignores/ignoreCFMLFunction.expected.txt index 7607703df..c42dd76b1 100644 --- a/src/test/resources/com/cflint/tests/Ignores/ignoreCFMLFunction.expected.txt +++ b/src/test/resources/com/cflint/tests/Ignores/ignoreCFMLFunction.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202129", + "timestamp" : 1501392723, "issues" : [ ], "counts" : { "totalFiles" : 0, diff --git a/src/test/resources/com/cflint/tests/Ignores/ignoreLine1.expected.txt b/src/test/resources/com/cflint/tests/Ignores/ignoreLine1.expected.txt index 7607703df..c42dd76b1 100644 --- a/src/test/resources/com/cflint/tests/Ignores/ignoreLine1.expected.txt +++ b/src/test/resources/com/cflint/tests/Ignores/ignoreLine1.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202129", + "timestamp" : 1501392723, "issues" : [ ], "counts" : { "totalFiles" : 0, diff --git a/src/test/resources/com/cflint/tests/Ignores/ignoreLineMessage1.expected.txt b/src/test/resources/com/cflint/tests/Ignores/ignoreLineMessage1.expected.txt index 7607703df..c42dd76b1 100644 --- a/src/test/resources/com/cflint/tests/Ignores/ignoreLineMessage1.expected.txt +++ b/src/test/resources/com/cflint/tests/Ignores/ignoreLineMessage1.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202129", + "timestamp" : 1501392723, "issues" : [ ], "counts" : { "totalFiles" : 0, diff --git a/src/test/resources/com/cflint/tests/Ignores/ignoreLineMessageUnmatched.expected.txt b/src/test/resources/com/cflint/tests/Ignores/ignoreLineMessageUnmatched.expected.txt index b17bf2f03..e31833f7d 100644 --- a/src/test/resources/com/cflint/tests/Ignores/ignoreLineMessageUnmatched.expected.txt +++ b/src/test/resources/com/cflint/tests/Ignores/ignoreLineMessageUnmatched.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202129", + "timestamp" : 1501392724, "issues" : [ { "severity" : "ERROR", "id" : "MISSING_VAR", diff --git a/src/test/resources/com/cflint/tests/Ignores/ignoreMultiLine.expected.txt b/src/test/resources/com/cflint/tests/Ignores/ignoreMultiLine.expected.txt index 3c1ebdada..2799fed26 100644 --- a/src/test/resources/com/cflint/tests/Ignores/ignoreMultiLine.expected.txt +++ b/src/test/resources/com/cflint/tests/Ignores/ignoreMultiLine.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202129", + "timestamp" : 1501392724, "issues" : [ { "severity" : "ERROR", "id" : "MISSING_VAR", diff --git a/src/test/resources/com/cflint/tests/Ignores/ignoreMultiLine2.expected.txt b/src/test/resources/com/cflint/tests/Ignores/ignoreMultiLine2.expected.txt index 7607703df..a42f815ae 100644 --- a/src/test/resources/com/cflint/tests/Ignores/ignoreMultiLine2.expected.txt +++ b/src/test/resources/com/cflint/tests/Ignores/ignoreMultiLine2.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202129", + "timestamp" : 1501392724, "issues" : [ ], "counts" : { "totalFiles" : 0, diff --git a/src/test/resources/com/cflint/tests/Ignores/ignoreMultiLineComponent.expected.txt b/src/test/resources/com/cflint/tests/Ignores/ignoreMultiLineComponent.expected.txt index 28c42f4ab..e5bfd95e3 100644 --- a/src/test/resources/com/cflint/tests/Ignores/ignoreMultiLineComponent.expected.txt +++ b/src/test/resources/com/cflint/tests/Ignores/ignoreMultiLineComponent.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202129", + "timestamp" : 1501392724, "issues" : [ { "severity" : "ERROR", "id" : "MISSING_VAR", diff --git a/src/test/resources/com/cflint/tests/Ignores/ignoreMultiLineComponent2.expected.txt b/src/test/resources/com/cflint/tests/Ignores/ignoreMultiLineComponent2.expected.txt index 7607703df..a42f815ae 100644 --- a/src/test/resources/com/cflint/tests/Ignores/ignoreMultiLineComponent2.expected.txt +++ b/src/test/resources/com/cflint/tests/Ignores/ignoreMultiLineComponent2.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202129", + "timestamp" : 1501392724, "issues" : [ ], "counts" : { "totalFiles" : 0, diff --git a/src/test/resources/com/cflint/tests/Includes/Header.expected.txt b/src/test/resources/com/cflint/tests/Includes/Header.expected.txt index 0518ad836..3f0203e46 100644 --- a/src/test/resources/com/cflint/tests/Includes/Header.expected.txt +++ b/src/test/resources/com/cflint/tests/Includes/Header.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202129", + "timestamp" : 1501392724, "issues" : [ { "severity" : "WARNING", "id" : "GLOBAL_LITERAL_VALUE_USED_TOO_OFTEN", diff --git a/src/test/resources/com/cflint/tests/Includes/Template.expected.txt b/src/test/resources/com/cflint/tests/Includes/Template.expected.txt index 57c1e256e..657a34af3 100644 --- a/src/test/resources/com/cflint/tests/Includes/Template.expected.txt +++ b/src/test/resources/com/cflint/tests/Includes/Template.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202130", + "timestamp" : 1501392724, "issues" : [ { "severity" : "WARNING", "id" : "GLOBAL_LITERAL_VALUE_USED_TOO_OFTEN", diff --git a/src/test/resources/com/cflint/tests/LiteralChecker/literal_arraysort.expected.txt b/src/test/resources/com/cflint/tests/LiteralChecker/literal_arraysort.expected.txt index 3bf81006a..93fce5b07 100644 --- a/src/test/resources/com/cflint/tests/LiteralChecker/literal_arraysort.expected.txt +++ b/src/test/resources/com/cflint/tests/LiteralChecker/literal_arraysort.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202130", + "timestamp" : 1501392725, "issues" : [ ], "counts" : { "totalFiles" : 0, diff --git a/src/test/resources/com/cflint/tests/LiteralChecker/literal_checker_326.expected.txt b/src/test/resources/com/cflint/tests/LiteralChecker/literal_checker_326.expected.txt index 703af3dfe..b3e8c9abc 100644 --- a/src/test/resources/com/cflint/tests/LiteralChecker/literal_checker_326.expected.txt +++ b/src/test/resources/com/cflint/tests/LiteralChecker/literal_checker_326.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202130", + "timestamp" : 1501392725, "issues" : [ { "severity" : "WARNING", "id" : "GLOBAL_LITERAL_VALUE_USED_TOO_OFTEN", diff --git a/src/test/resources/com/cflint/tests/MissingSemiColon/missingSemis1.expected.txt b/src/test/resources/com/cflint/tests/MissingSemiColon/missingSemis1.expected.txt index 2de377e1b..be410b819 100644 --- a/src/test/resources/com/cflint/tests/MissingSemiColon/missingSemis1.expected.txt +++ b/src/test/resources/com/cflint/tests/MissingSemiColon/missingSemis1.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202130", + "timestamp" : 1501392725, "issues" : [ { "severity" : "ERROR", "id" : "MISSING_SEMI", diff --git a/src/test/resources/com/cflint/tests/Naming/nameEndsInNumberScript.expected.txt b/src/test/resources/com/cflint/tests/Naming/nameEndsInNumberScript.expected.txt index e99a80ce1..f978c777e 100644 --- a/src/test/resources/com/cflint/tests/Naming/nameEndsInNumberScript.expected.txt +++ b/src/test/resources/com/cflint/tests/Naming/nameEndsInNumberScript.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202130", + "timestamp" : 1501392725, "issues" : [ { "severity" : "INFO", "id" : "VAR_INVALID_NAME", diff --git a/src/test/resources/com/cflint/tests/Naming/tempVar.expected.txt b/src/test/resources/com/cflint/tests/Naming/tempVar.expected.txt index 5f797ce00..5ebb0cac4 100644 --- a/src/test/resources/com/cflint/tests/Naming/tempVar.expected.txt +++ b/src/test/resources/com/cflint/tests/Naming/tempVar.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202130", + "timestamp" : 1501392726, "issues" : [ { "severity" : "INFO", "id" : "VAR_IS_TEMPORARY", diff --git a/src/test/resources/com/cflint/tests/PackageCase/packagecase_nok.expected.txt b/src/test/resources/com/cflint/tests/PackageCase/packagecase_nok.expected.txt index 6e3f96c80..9b213f677 100644 --- a/src/test/resources/com/cflint/tests/PackageCase/packagecase_nok.expected.txt +++ b/src/test/resources/com/cflint/tests/PackageCase/packagecase_nok.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202130", + "timestamp" : 1501392726, "issues" : [ { "severity" : "WARNING", "id" : "PACKAGE_CASE_MISMATCH", diff --git a/src/test/resources/com/cflint/tests/PackageCase/packagecase_nokC.expected.txt b/src/test/resources/com/cflint/tests/PackageCase/packagecase_nokC.expected.txt index 350cb0eba..2bc9760be 100644 --- a/src/test/resources/com/cflint/tests/PackageCase/packagecase_nokC.expected.txt +++ b/src/test/resources/com/cflint/tests/PackageCase/packagecase_nokC.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202131", + "timestamp" : 1501392726, "issues" : [ { "severity" : "WARNING", "id" : "PACKAGE_CASE_MISMATCH", diff --git a/src/test/resources/com/cflint/tests/PackageCase/packagecase_nok_b.expected.txt b/src/test/resources/com/cflint/tests/PackageCase/packagecase_nok_b.expected.txt index 176310dbe..b1718fa7b 100644 --- a/src/test/resources/com/cflint/tests/PackageCase/packagecase_nok_b.expected.txt +++ b/src/test/resources/com/cflint/tests/PackageCase/packagecase_nok_b.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202131", + "timestamp" : 1501392726, "issues" : [ { "severity" : "WARNING", "id" : "PACKAGE_CASE_MISMATCH", diff --git a/src/test/resources/com/cflint/tests/PackageCase/packagecase_ok.expected.txt b/src/test/resources/com/cflint/tests/PackageCase/packagecase_ok.expected.txt index bd42a4af1..0025de9cd 100644 --- a/src/test/resources/com/cflint/tests/PackageCase/packagecase_ok.expected.txt +++ b/src/test/resources/com/cflint/tests/PackageCase/packagecase_ok.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202131", + "timestamp" : 1501392726, "issues" : [ ], "counts" : { "totalFiles" : 0, diff --git a/src/test/resources/com/cflint/tests/ParseError/cfloop_359.expected.txt b/src/test/resources/com/cflint/tests/ParseError/cfloop_359.expected.txt index bd42a4af1..0025de9cd 100644 --- a/src/test/resources/com/cflint/tests/ParseError/cfloop_359.expected.txt +++ b/src/test/resources/com/cflint/tests/ParseError/cfloop_359.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202131", + "timestamp" : 1501392726, "issues" : [ ], "counts" : { "totalFiles" : 0, diff --git a/src/test/resources/com/cflint/tests/ParseError/fileoutput_359.expected.txt b/src/test/resources/com/cflint/tests/ParseError/fileoutput_359.expected.txt index bd42a4af1..0025de9cd 100644 --- a/src/test/resources/com/cflint/tests/ParseError/fileoutput_359.expected.txt +++ b/src/test/resources/com/cflint/tests/ParseError/fileoutput_359.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202131", + "timestamp" : 1501392726, "issues" : [ ], "counts" : { "totalFiles" : 0, diff --git a/src/test/resources/com/cflint/tests/ParseError/outside_output_359.expected.txt b/src/test/resources/com/cflint/tests/ParseError/outside_output_359.expected.txt index bd42a4af1..76ce5eccb 100644 --- a/src/test/resources/com/cflint/tests/ParseError/outside_output_359.expected.txt +++ b/src/test/resources/com/cflint/tests/ParseError/outside_output_359.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202131", + "timestamp" : 1501392727, "issues" : [ ], "counts" : { "totalFiles" : 0, diff --git a/src/test/resources/com/cflint/tests/ParseError/singlequote_359.expected.txt b/src/test/resources/com/cflint/tests/ParseError/singlequote_359.expected.txt index bd42a4af1..76ce5eccb 100644 --- a/src/test/resources/com/cflint/tests/ParseError/singlequote_359.expected.txt +++ b/src/test/resources/com/cflint/tests/ParseError/singlequote_359.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202131", + "timestamp" : 1501392727, "issues" : [ ], "counts" : { "totalFiles" : 0, diff --git a/src/test/resources/com/cflint/tests/Parsing/.cflintrc b/src/test/resources/com/cflint/tests/Parsing/.cflintrc index eac9ed04c..50807aa01 100644 --- a/src/test/resources/com/cflint/tests/Parsing/.cflintrc +++ b/src/test/resources/com/cflint/tests/Parsing/.cflintrc @@ -3,9 +3,8 @@ "rule" : [ ], "excludes" : [ ], "includes" : [ { - "code" : "MISSING_VAR", - "messageText" : null, - "severity" : null - } ], + "code" : "MISSING_VAR" + }, + { "code" : "PARSE_ERROR"} ], "inheritParent" : false } \ No newline at end of file diff --git a/src/test/resources/com/cflint/tests/Parsing/Underscore.expected.txt b/src/test/resources/com/cflint/tests/Parsing/Underscore.expected.txt index ebd9463b5..76ce5eccb 100644 --- a/src/test/resources/com/cflint/tests/Parsing/Underscore.expected.txt +++ b/src/test/resources/com/cflint/tests/Parsing/Underscore.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202132", + "timestamp" : 1501392727, "issues" : [ ], "counts" : { "totalFiles" : 0, diff --git a/src/test/resources/com/cflint/tests/Parsing/import_359.cfc b/src/test/resources/com/cflint/tests/Parsing/import_359.cfc new file mode 100644 index 000000000..34aa1f1d2 --- /dev/null +++ b/src/test/resources/com/cflint/tests/Parsing/import_359.cfc @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/test/resources/com/cflint/tests/Parsing/import_359.expected.txt b/src/test/resources/com/cflint/tests/Parsing/import_359.expected.txt new file mode 100644 index 000000000..bd05d8eeb --- /dev/null +++ b/src/test/resources/com/cflint/tests/Parsing/import_359.expected.txt @@ -0,0 +1,11 @@ +{ + "version" : "", + "timestamp" : 0, + "issues" : [ ], + "counts" : { + "totalFiles" : 0, + "totalLines" : 0, + "countByCode" : [ ], + "countBySeverity" : [ ] + } +} \ No newline at end of file diff --git a/src/test/resources/com/cflint/tests/Parsing/npe_408.cfc b/src/test/resources/com/cflint/tests/Parsing/npe_408.cfc new file mode 100644 index 000000000..6053fa304 --- /dev/null +++ b/src/test/resources/com/cflint/tests/Parsing/npe_408.cfc @@ -0,0 +1,8 @@ + + // Loop over each CSS pair. + for ( + local.PairIterator = local.Pairs.Iterator() ; + local.PairIterator.HasNext() ; + ){ + } + \ No newline at end of file diff --git a/src/test/resources/com/cflint/tests/Parsing/npe_408.expected.txt b/src/test/resources/com/cflint/tests/Parsing/npe_408.expected.txt new file mode 100644 index 000000000..6ba10d387 --- /dev/null +++ b/src/test/resources/com/cflint/tests/Parsing/npe_408.expected.txt @@ -0,0 +1,33 @@ +{ + "version" : "", + "timestamp" : 0, + "issues" : [ { + "severity" : "ERROR", + "id" : "PARSE_ERROR", + "message" : "PARSE_ERROR", + "category" : "CFLINT", + "abbrev" : "PE", + "locations" : [ { + "file" : "src/test/resources/com/cflint/tests/Parsing/npe_408.cfc", + "fileName" : "npe_408.cfc", + "function" : "", + "column" : 0, + "line" : 1, + "message" : "Unable to parse", + "variable" : "", + "expression" : "/r/n/t/ Loop over each CSS pair./r/n/tfor (/r/n/t/tlocal.PairIterator = local.Pairs.Iterator() ;/r/n/t/tlocal.PairIterator.HasNext() ;/r/n/t/t){/r/n/t}/r/n" + } ] + } ], + "counts" : { + "totalFiles" : 0, + "totalLines" : 0, + "countByCode" : [ { + "code" : "PARSE_ERROR", + "count" : 1 + } ], + "countBySeverity" : [ { + "severity" : "ERROR", + "count" : 1 + } ] + } +} \ No newline at end of file diff --git a/src/test/resources/com/cflint/tests/Parsing/parsing251.expected.txt b/src/test/resources/com/cflint/tests/Parsing/parsing251.expected.txt index ebd9463b5..76ce5eccb 100644 --- a/src/test/resources/com/cflint/tests/Parsing/parsing251.expected.txt +++ b/src/test/resources/com/cflint/tests/Parsing/parsing251.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202132", + "timestamp" : 1501392727, "issues" : [ ], "counts" : { "totalFiles" : 0, diff --git a/src/test/resources/com/cflint/tests/Parsing/parsing253.expected.txt b/src/test/resources/com/cflint/tests/Parsing/parsing253.expected.txt index 4e175446c..a689c5384 100644 --- a/src/test/resources/com/cflint/tests/Parsing/parsing253.expected.txt +++ b/src/test/resources/com/cflint/tests/Parsing/parsing253.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202132", + "timestamp" : 1501392727, "issues" : [ { "severity" : "ERROR", "id" : "MISSING_VAR", diff --git a/src/test/resources/com/cflint/tests/Parsing/parsing_346.cfc b/src/test/resources/com/cflint/tests/Parsing/parsing_346.cfc new file mode 100644 index 000000000..655b3abdb --- /dev/null +++ b/src/test/resources/com/cflint/tests/Parsing/parsing_346.cfc @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/src/test/resources/com/cflint/tests/Parsing/parsing_346.expected.txt b/src/test/resources/com/cflint/tests/Parsing/parsing_346.expected.txt new file mode 100644 index 000000000..fb8b9920e --- /dev/null +++ b/src/test/resources/com/cflint/tests/Parsing/parsing_346.expected.txt @@ -0,0 +1,11 @@ +{ + "version" : "", + "timestamp" : 1502314535, + "issues" : [ ], + "counts" : { + "totalFiles" : 0, + "totalLines" : 0, + "countByCode" : [ ], + "countBySeverity" : [ ] + } +} \ No newline at end of file diff --git a/src/test/resources/com/cflint/tests/Query/cfquery_param.expected.txt b/src/test/resources/com/cflint/tests/Query/cfquery_param.expected.txt index ebd9463b5..76ce5eccb 100644 --- a/src/test/resources/com/cflint/tests/Query/cfquery_param.expected.txt +++ b/src/test/resources/com/cflint/tests/Query/cfquery_param.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202132", + "timestamp" : 1501392727, "issues" : [ ], "counts" : { "totalFiles" : 0, diff --git a/src/test/resources/com/cflint/tests/Query/cfquery_param2.expected.txt b/src/test/resources/com/cflint/tests/Query/cfquery_param2.expected.txt index ebd9463b5..76ce5eccb 100644 --- a/src/test/resources/com/cflint/tests/Query/cfquery_param2.expected.txt +++ b/src/test/resources/com/cflint/tests/Query/cfquery_param2.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202132", + "timestamp" : 1501392727, "issues" : [ ], "counts" : { "totalFiles" : 0, diff --git a/src/test/resources/com/cflint/tests/Query/cfquery_param3.expected.txt b/src/test/resources/com/cflint/tests/Query/cfquery_param3.expected.txt index a5256d1d5..0a543bb23 100644 --- a/src/test/resources/com/cflint/tests/Query/cfquery_param3.expected.txt +++ b/src/test/resources/com/cflint/tests/Query/cfquery_param3.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202132", + "timestamp" : 1501392728, "issues" : [ { "severity" : "WARNING", "id" : "CFQUERYPARAM_REQ", diff --git a/src/test/resources/com/cflint/tests/Query/cfquery_param_byline.expected.txt b/src/test/resources/com/cflint/tests/Query/cfquery_param_byline.expected.txt index 63ce722ee..60b213280 100644 --- a/src/test/resources/com/cflint/tests/Query/cfquery_param_byline.expected.txt +++ b/src/test/resources/com/cflint/tests/Query/cfquery_param_byline.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202132", + "timestamp" : 1501392728, "issues" : [ { "severity" : "WARNING", "id" : "CFQUERYPARAM_REQ", diff --git a/src/test/resources/com/cflint/tests/Query/cfquery_param_byline_nest.expected.txt b/src/test/resources/com/cflint/tests/Query/cfquery_param_byline_nest.expected.txt index 32d699ba3..ad36aad32 100644 --- a/src/test/resources/com/cflint/tests/Query/cfquery_param_byline_nest.expected.txt +++ b/src/test/resources/com/cflint/tests/Query/cfquery_param_byline_nest.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202133", + "timestamp" : 1501392728, "issues" : [ { "severity" : "WARNING", "id" : "CFQUERYPARAM_REQ", diff --git a/src/test/resources/com/cflint/tests/Query/cfquery_param_case.cfc b/src/test/resources/com/cflint/tests/Query/cfquery_param_case.cfc new file mode 100644 index 000000000..c4e703a7e --- /dev/null +++ b/src/test/resources/com/cflint/tests/Query/cfquery_param_case.cfc @@ -0,0 +1,11 @@ + + + + +SELECT user +FROM users +where user_id = + + + + \ No newline at end of file diff --git a/src/test/resources/com/cflint/tests/Query/cfquery_param_case.expected.txt b/src/test/resources/com/cflint/tests/Query/cfquery_param_case.expected.txt new file mode 100644 index 000000000..d0ea69316 --- /dev/null +++ b/src/test/resources/com/cflint/tests/Query/cfquery_param_case.expected.txt @@ -0,0 +1,33 @@ +{ + "version" : "", + "timestamp" : 0, + "issues" : [ { + "severity" : "ERROR", + "id" : "MISSING_VAR", + "message" : "MISSING_VAR", + "category" : "CFLINT", + "abbrev" : "MV", + "locations" : [ { + "file" : "src/test/resources/com/cflint/tests/Query/cfquery_param_case.cfc", + "fileName" : "cfquery_param_case.cfc", + "function" : "foo", + "column" : 1, + "line" : 4, + "message" : "Variable users is not declared with a var statement.", + "variable" : "users", + "expression" : "/r/nSELECT user/r/nFROM users/r/nwhere user_id = /r/n" + } ] + } ], + "counts" : { + "totalFiles" : 0, + "totalLines" : 0, + "countByCode" : [ { + "code" : "MISSING_VAR", + "count" : 1 + } ], + "countBySeverity" : [ { + "severity" : "ERROR", + "count" : 1 + } ] + } +} \ No newline at end of file diff --git a/src/test/resources/com/cflint/tests/TooManyFunctionsChecker/.cflintrc b/src/test/resources/com/cflint/tests/TooManyFunctionsChecker/.cflintrc new file mode 100644 index 000000000..b2b3d55e2 --- /dev/null +++ b/src/test/resources/com/cflint/tests/TooManyFunctionsChecker/.cflintrc @@ -0,0 +1,9 @@ +{ + "output" : [ ], + "rule" : [ ], + "excludes" : [ ], + "includes" : [ { + "code" : "EXCESSIVE_FUNCTIONS"} + ], + "inheritParent" : false +} \ No newline at end of file diff --git a/src/test/resources/com/cflint/tests/StructKeyQuoted/.cflintrc b/src/test/resources/com/cflint/tests/TooManyFunctionsChecker/StructKeyQuoted/.cflintrc similarity index 100% rename from src/test/resources/com/cflint/tests/StructKeyQuoted/.cflintrc rename to src/test/resources/com/cflint/tests/TooManyFunctionsChecker/StructKeyQuoted/.cflintrc diff --git a/src/test/resources/com/cflint/tests/StructKeyQuoted/quotedStructKey2.cfc b/src/test/resources/com/cflint/tests/TooManyFunctionsChecker/StructKeyQuoted/quotedStructKey2.cfc similarity index 100% rename from src/test/resources/com/cflint/tests/StructKeyQuoted/quotedStructKey2.cfc rename to src/test/resources/com/cflint/tests/TooManyFunctionsChecker/StructKeyQuoted/quotedStructKey2.cfc diff --git a/src/test/resources/com/cflint/tests/StructKeyQuoted/quotedStructKey2.expected.txt b/src/test/resources/com/cflint/tests/TooManyFunctionsChecker/StructKeyQuoted/quotedStructKey2.expected.txt similarity index 83% rename from src/test/resources/com/cflint/tests/StructKeyQuoted/quotedStructKey2.expected.txt rename to src/test/resources/com/cflint/tests/TooManyFunctionsChecker/StructKeyQuoted/quotedStructKey2.expected.txt index 556c71638..e78189e68 100644 --- a/src/test/resources/com/cflint/tests/StructKeyQuoted/quotedStructKey2.expected.txt +++ b/src/test/resources/com/cflint/tests/TooManyFunctionsChecker/StructKeyQuoted/quotedStructKey2.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202133", + "timestamp" : 1501392728, "issues" : [ ], "counts" : { "totalFiles" : 0, diff --git a/src/test/resources/com/cflint/tests/StructKeyQuoted/unquotedStructKey.cfc b/src/test/resources/com/cflint/tests/TooManyFunctionsChecker/StructKeyQuoted/unquotedStructKey.cfc similarity index 100% rename from src/test/resources/com/cflint/tests/StructKeyQuoted/unquotedStructKey.cfc rename to src/test/resources/com/cflint/tests/TooManyFunctionsChecker/StructKeyQuoted/unquotedStructKey.cfc diff --git a/src/test/resources/com/cflint/tests/StructKeyQuoted/unquotedStructKey.expected.txt b/src/test/resources/com/cflint/tests/TooManyFunctionsChecker/StructKeyQuoted/unquotedStructKey.expected.txt similarity index 84% rename from src/test/resources/com/cflint/tests/StructKeyQuoted/unquotedStructKey.expected.txt rename to src/test/resources/com/cflint/tests/TooManyFunctionsChecker/StructKeyQuoted/unquotedStructKey.expected.txt index afdd05da0..09393520b 100644 --- a/src/test/resources/com/cflint/tests/StructKeyQuoted/unquotedStructKey.expected.txt +++ b/src/test/resources/com/cflint/tests/TooManyFunctionsChecker/StructKeyQuoted/unquotedStructKey.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202133", + "timestamp" : 0, "issues" : [ { "severity" : "WARNING", "id" : "UNQUOTED_STRUCT_KEY", @@ -8,7 +8,7 @@ "category" : "CFLINT", "abbrev" : "US", "locations" : [ { - "file" : "src/test/resources/com/cflint/tests/StructKeyQuoted/unquotedStructKey.cfc", + "file" : "src/test/resources/com/cflint/tests/TooManyFunctionsChecker/StructKeyQuoted/unquotedStructKey.cfc", "fileName" : "unquotedStructKey.cfc", "function" : "x", "column" : 16, diff --git a/src/test/resources/com/cflint/tests/StructKeyQuoted/unquotedStructKeyNested.cfc b/src/test/resources/com/cflint/tests/TooManyFunctionsChecker/StructKeyQuoted/unquotedStructKeyNested.cfc similarity index 100% rename from src/test/resources/com/cflint/tests/StructKeyQuoted/unquotedStructKeyNested.cfc rename to src/test/resources/com/cflint/tests/TooManyFunctionsChecker/StructKeyQuoted/unquotedStructKeyNested.cfc diff --git a/src/test/resources/com/cflint/tests/StructKeyQuoted/unquotedStructKeyNested.expected.txt b/src/test/resources/com/cflint/tests/TooManyFunctionsChecker/StructKeyQuoted/unquotedStructKeyNested.expected.txt similarity index 84% rename from src/test/resources/com/cflint/tests/StructKeyQuoted/unquotedStructKeyNested.expected.txt rename to src/test/resources/com/cflint/tests/TooManyFunctionsChecker/StructKeyQuoted/unquotedStructKeyNested.expected.txt index 19747688f..7dde83eaf 100644 --- a/src/test/resources/com/cflint/tests/StructKeyQuoted/unquotedStructKeyNested.expected.txt +++ b/src/test/resources/com/cflint/tests/TooManyFunctionsChecker/StructKeyQuoted/unquotedStructKeyNested.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202133", + "timestamp" : 0, "issues" : [ { "severity" : "WARNING", "id" : "UNQUOTED_STRUCT_KEY", @@ -8,7 +8,7 @@ "category" : "CFLINT", "abbrev" : "US", "locations" : [ { - "file" : "src/test/resources/com/cflint/tests/StructKeyQuoted/unquotedStructKeyNested.cfc", + "file" : "src/test/resources/com/cflint/tests/TooManyFunctionsChecker/StructKeyQuoted/unquotedStructKeyNested.cfc", "fileName" : "unquotedStructKeyNested.cfc", "function" : "x", "column" : 15, diff --git a/src/test/resources/com/cflint/tests/TooManyFunctionsChecker/excessive_cfml.cfc b/src/test/resources/com/cflint/tests/TooManyFunctionsChecker/excessive_cfml.cfc new file mode 100644 index 000000000..63887ab48 --- /dev/null +++ b/src/test/resources/com/cflint/tests/TooManyFunctionsChecker/excessive_cfml.cfc @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/test/resources/com/cflint/tests/TooManyFunctionsChecker/excessive_cfml.expected.txt b/src/test/resources/com/cflint/tests/TooManyFunctionsChecker/excessive_cfml.expected.txt new file mode 100644 index 000000000..061c06b29 --- /dev/null +++ b/src/test/resources/com/cflint/tests/TooManyFunctionsChecker/excessive_cfml.expected.txt @@ -0,0 +1,33 @@ +{ + "version" : "", + "timestamp" : 1502072960, + "issues" : [ { + "severity" : "WARNING", + "id" : "EXCESSIVE_FUNCTIONS", + "message" : "EXCESSIVE_FUNCTIONS", + "category" : "CFLINT", + "abbrev" : "EF", + "locations" : [ { + "file" : "src\\test\\resources\\com\\cflint\\tests\\TooManyFunctionsChecker\\excessive_cfml.cfc", + "fileName" : "excessive_cfml.cfc", + "function" : "", + "column" : 0, + "line" : 1, + "message" : "Component excessive_cfml has too many functions. Should be fewer than 10.", + "variable" : "", + "expression" : "\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t + + + + + + + + + + \ No newline at end of file diff --git a/src/test/resources/com/cflint/tests/TooManyFunctionsChecker/excessive_cfml2.expected.txt b/src/test/resources/com/cflint/tests/TooManyFunctionsChecker/excessive_cfml2.expected.txt new file mode 100644 index 000000000..4ae25aba7 --- /dev/null +++ b/src/test/resources/com/cflint/tests/TooManyFunctionsChecker/excessive_cfml2.expected.txt @@ -0,0 +1,11 @@ +{ + "version" : "", + "timestamp" : 1502073393, + "issues" : [ ], + "counts" : { + "totalFiles" : 0, + "totalLines" : 0, + "countByCode" : [ ], + "countBySeverity" : [ ] + } +} \ No newline at end of file diff --git a/src/test/resources/com/cflint/tests/TooManyFunctionsChecker/excessive_cfscript.cfc b/src/test/resources/com/cflint/tests/TooManyFunctionsChecker/excessive_cfscript.cfc new file mode 100644 index 000000000..cdfc142c5 --- /dev/null +++ b/src/test/resources/com/cflint/tests/TooManyFunctionsChecker/excessive_cfscript.cfc @@ -0,0 +1,14 @@ +component { + public void function functionOne() {} + public void function functionTwo() {} + public void function functionThree() {} + public void function functionFour() {} + public void function functionFive() {} + public void function functionSix() {} + public void function functionSeven() {} + public void function functionEight() {} + public void function functionNine() {} + public void function functionTen() {} + public void function functionEleven() {} + public void function function12() {} +} \ No newline at end of file diff --git a/src/test/resources/com/cflint/tests/TooManyFunctionsChecker/excessive_cfscript.expected.txt b/src/test/resources/com/cflint/tests/TooManyFunctionsChecker/excessive_cfscript.expected.txt new file mode 100644 index 000000000..e0d6a6641 --- /dev/null +++ b/src/test/resources/com/cflint/tests/TooManyFunctionsChecker/excessive_cfscript.expected.txt @@ -0,0 +1,33 @@ +{ + "version" : "", + "timestamp" : 0, + "issues" : [ { + "severity" : "WARNING", + "id" : "EXCESSIVE_FUNCTIONS", + "message" : "EXCESSIVE_FUNCTIONS", + "category" : "CFLINT", + "abbrev" : "EF", + "locations" : [ { + "file" : "src/test/resources/com/cflint/tests/TooManyFunctionsChecker/excessive_cfscript.cfc", + "fileName" : "excessive_cfscript.cfc", + "function" : "", + "column" : 0, + "line" : 1, + "message" : "Component excessive_cfscript has too many functions. Should be fewer than 10.", + "variable" : "", + "expression" : "" + } ] + } ], + "counts" : { + "totalFiles" : 0, + "totalLines" : 0, + "countByCode" : [ { + "code" : "EXCESSIVE_FUNCTIONS", + "count" : 1 + } ], + "countBySeverity" : [ { + "severity" : "WARNING", + "count" : 1 + } ] + } +} \ No newline at end of file diff --git a/src/test/resources/com/cflint/tests/TooManyFunctionsChecker/excessive_cfscript2.cfc b/src/test/resources/com/cflint/tests/TooManyFunctionsChecker/excessive_cfscript2.cfc new file mode 100644 index 000000000..b2d81955f --- /dev/null +++ b/src/test/resources/com/cflint/tests/TooManyFunctionsChecker/excessive_cfscript2.cfc @@ -0,0 +1,11 @@ +component { + public void function functionOne() {} + public void function functionTwo() {} + public void function functionThree() {} + public void function functionFour() {} + public void function functionFive() {} + public void function functionSix() {} + public void function functionSeven() {} + public void function functionEight() {} + public void function functionNine() {} +} \ No newline at end of file diff --git a/src/test/resources/com/cflint/tests/TooManyFunctionsChecker/excessive_cfscript2.expected.txt b/src/test/resources/com/cflint/tests/TooManyFunctionsChecker/excessive_cfscript2.expected.txt new file mode 100644 index 000000000..383eda6ae --- /dev/null +++ b/src/test/resources/com/cflint/tests/TooManyFunctionsChecker/excessive_cfscript2.expected.txt @@ -0,0 +1,11 @@ +{ + "version" : "", + "timestamp" : 1502073373, + "issues" : [ ], + "counts" : { + "totalFiles" : 0, + "totalLines" : 0, + "countByCode" : [ ], + "countBySeverity" : [ ] + } +} \ No newline at end of file diff --git a/src/test/resources/com/cflint/tests/UnusedArgument/UnusedArgument_152.expected.txt b/src/test/resources/com/cflint/tests/UnusedArgument/UnusedArgument_152.expected.txt index 556c71638..e78189e68 100644 --- a/src/test/resources/com/cflint/tests/UnusedArgument/UnusedArgument_152.expected.txt +++ b/src/test/resources/com/cflint/tests/UnusedArgument/UnusedArgument_152.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202133", + "timestamp" : 1501392728, "issues" : [ ], "counts" : { "totalFiles" : 0, diff --git a/src/test/resources/com/cflint/tests/UnusedArgument/UnusedArgument_152b.expected.txt b/src/test/resources/com/cflint/tests/UnusedArgument/UnusedArgument_152b.expected.txt index c6148d658..77f2b552e 100644 --- a/src/test/resources/com/cflint/tests/UnusedArgument/UnusedArgument_152b.expected.txt +++ b/src/test/resources/com/cflint/tests/UnusedArgument/UnusedArgument_152b.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202133", + "timestamp" : 1501392728, "issues" : [ { "severity" : "INFO", "id" : "UNUSED_METHOD_ARGUMENT", diff --git a/src/test/resources/com/cflint/tests/UnusedArgument/UnusedArgument_227.expected.txt b/src/test/resources/com/cflint/tests/UnusedArgument/UnusedArgument_227.expected.txt index 556c71638..e78189e68 100644 --- a/src/test/resources/com/cflint/tests/UnusedArgument/UnusedArgument_227.expected.txt +++ b/src/test/resources/com/cflint/tests/UnusedArgument/UnusedArgument_227.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202133", + "timestamp" : 1501392728, "issues" : [ ], "counts" : { "totalFiles" : 0, diff --git a/src/test/resources/com/cflint/tests/UnusedArgument/UnusedArgument_257.expected.txt b/src/test/resources/com/cflint/tests/UnusedArgument/UnusedArgument_257.expected.txt index 556c71638..e78189e68 100644 --- a/src/test/resources/com/cflint/tests/UnusedArgument/UnusedArgument_257.expected.txt +++ b/src/test/resources/com/cflint/tests/UnusedArgument/UnusedArgument_257.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202133", + "timestamp" : 1501392728, "issues" : [ ], "counts" : { "totalFiles" : 0, diff --git a/src/test/resources/com/cflint/tests/UnusedArgument/UnusedArgument_257b.expected.txt b/src/test/resources/com/cflint/tests/UnusedArgument/UnusedArgument_257b.expected.txt index 653ddff52..04b8e1db3 100644 --- a/src/test/resources/com/cflint/tests/UnusedArgument/UnusedArgument_257b.expected.txt +++ b/src/test/resources/com/cflint/tests/UnusedArgument/UnusedArgument_257b.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202134", + "timestamp" : 1501392729, "issues" : [ ], "counts" : { "totalFiles" : 0, diff --git a/src/test/resources/com/cflint/tests/UnusedArgument/UnusedArgument_Case_234.expected.txt b/src/test/resources/com/cflint/tests/UnusedArgument/UnusedArgument_Case_234.expected.txt index 653ddff52..04b8e1db3 100644 --- a/src/test/resources/com/cflint/tests/UnusedArgument/UnusedArgument_Case_234.expected.txt +++ b/src/test/resources/com/cflint/tests/UnusedArgument/UnusedArgument_Case_234.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202134", + "timestamp" : 1501392729, "issues" : [ ], "counts" : { "totalFiles" : 0, diff --git a/src/test/resources/com/cflint/tests/UnusedVariable/caselessVariable_242.expected.txt b/src/test/resources/com/cflint/tests/UnusedVariable/caselessVariable_242.expected.txt index 653ddff52..04b8e1db3 100644 --- a/src/test/resources/com/cflint/tests/UnusedVariable/caselessVariable_242.expected.txt +++ b/src/test/resources/com/cflint/tests/UnusedVariable/caselessVariable_242.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202134", + "timestamp" : 1501392729, "issues" : [ ], "counts" : { "totalFiles" : 0, diff --git a/src/test/resources/com/cflint/tests/UnusedVariable/cflog_339.expected.txt b/src/test/resources/com/cflint/tests/UnusedVariable/cflog_339.expected.txt index 653ddff52..04b8e1db3 100644 --- a/src/test/resources/com/cflint/tests/UnusedVariable/cflog_339.expected.txt +++ b/src/test/resources/com/cflint/tests/UnusedVariable/cflog_339.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202134", + "timestamp" : 1501392729, "issues" : [ ], "counts" : { "totalFiles" : 0, diff --git a/src/test/resources/com/cflint/tests/UnusedVariable/cfloopname_339.expected.txt b/src/test/resources/com/cflint/tests/UnusedVariable/cfloopname_339.expected.txt index 653ddff52..04b8e1db3 100644 --- a/src/test/resources/com/cflint/tests/UnusedVariable/cfloopname_339.expected.txt +++ b/src/test/resources/com/cflint/tests/UnusedVariable/cfloopname_339.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202134", + "timestamp" : 1501392729, "issues" : [ ], "counts" : { "totalFiles" : 0, diff --git a/src/test/resources/com/cflint/tests/UnusedVariable/cfquery_339.expected.txt b/src/test/resources/com/cflint/tests/UnusedVariable/cfquery_339.expected.txt index 653ddff52..04b8e1db3 100644 --- a/src/test/resources/com/cflint/tests/UnusedVariable/cfquery_339.expected.txt +++ b/src/test/resources/com/cflint/tests/UnusedVariable/cfquery_339.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202134", + "timestamp" : 1501392729, "issues" : [ ], "counts" : { "totalFiles" : 0, diff --git a/src/test/resources/com/cflint/tests/UnusedVariable/cfqueryname_339.expected.txt b/src/test/resources/com/cflint/tests/UnusedVariable/cfqueryname_339.expected.txt index 653ddff52..04b8e1db3 100644 --- a/src/test/resources/com/cflint/tests/UnusedVariable/cfqueryname_339.expected.txt +++ b/src/test/resources/com/cflint/tests/UnusedVariable/cfqueryname_339.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202134", + "timestamp" : 1501392729, "issues" : [ ], "counts" : { "totalFiles" : 0, diff --git a/src/test/resources/com/cflint/tests/UnusedVariable/cookie_339.expected.txt b/src/test/resources/com/cflint/tests/UnusedVariable/cookie_339.expected.txt index 653ddff52..04b8e1db3 100644 --- a/src/test/resources/com/cflint/tests/UnusedVariable/cookie_339.expected.txt +++ b/src/test/resources/com/cflint/tests/UnusedVariable/cookie_339.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202134", + "timestamp" : 1501392729, "issues" : [ ], "counts" : { "totalFiles" : 0, diff --git a/src/test/resources/com/cflint/tests/UnusedVariable/forLoop_211.expected.txt b/src/test/resources/com/cflint/tests/UnusedVariable/forLoop_211.expected.txt index 653ddff52..04b8e1db3 100644 --- a/src/test/resources/com/cflint/tests/UnusedVariable/forLoop_211.expected.txt +++ b/src/test/resources/com/cflint/tests/UnusedVariable/forLoop_211.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202134", + "timestamp" : 1501392729, "issues" : [ ], "counts" : { "totalFiles" : 0, diff --git a/src/test/resources/com/cflint/tests/UnusedVariable/forLoop_227.expected.txt b/src/test/resources/com/cflint/tests/UnusedVariable/forLoop_227.expected.txt index 653ddff52..a538549c1 100644 --- a/src/test/resources/com/cflint/tests/UnusedVariable/forLoop_227.expected.txt +++ b/src/test/resources/com/cflint/tests/UnusedVariable/forLoop_227.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202134", + "timestamp" : 1501392730, "issues" : [ ], "counts" : { "totalFiles" : 0, diff --git a/src/test/resources/com/cflint/tests/UnusedVariable/local_339.expected.txt b/src/test/resources/com/cflint/tests/UnusedVariable/local_339.expected.txt index 653ddff52..a538549c1 100644 --- a/src/test/resources/com/cflint/tests/UnusedVariable/local_339.expected.txt +++ b/src/test/resources/com/cflint/tests/UnusedVariable/local_339.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202134", + "timestamp" : 1501392730, "issues" : [ ], "counts" : { "totalFiles" : 0, diff --git a/src/test/resources/com/cflint/tests/UnusedVariable/location_339.expected.txt b/src/test/resources/com/cflint/tests/UnusedVariable/location_339.expected.txt index 3f6957f52..a538549c1 100644 --- a/src/test/resources/com/cflint/tests/UnusedVariable/location_339.expected.txt +++ b/src/test/resources/com/cflint/tests/UnusedVariable/location_339.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202135", + "timestamp" : 1501392730, "issues" : [ ], "counts" : { "totalFiles" : 0, diff --git a/src/test/resources/com/cflint/tests/UnusedVariable/loop_list_339.expected.txt b/src/test/resources/com/cflint/tests/UnusedVariable/loop_list_339.expected.txt index 3f6957f52..a538549c1 100644 --- a/src/test/resources/com/cflint/tests/UnusedVariable/loop_list_339.expected.txt +++ b/src/test/resources/com/cflint/tests/UnusedVariable/loop_list_339.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202135", + "timestamp" : 1501392730, "issues" : [ ], "counts" : { "totalFiles" : 0, diff --git a/src/test/resources/com/cflint/tests/UnusedVariable/simpleUnused.expected.txt b/src/test/resources/com/cflint/tests/UnusedVariable/simpleUnused.expected.txt index 677f627c0..58437526b 100644 --- a/src/test/resources/com/cflint/tests/UnusedVariable/simpleUnused.expected.txt +++ b/src/test/resources/com/cflint/tests/UnusedVariable/simpleUnused.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202135", + "timestamp" : 1501392730, "issues" : [ { "severity" : "INFO", "id" : "UNUSED_LOCAL_VARIABLE", diff --git a/src/test/resources/com/cflint/tests/VarScoper/cfloop_index_413.cfc b/src/test/resources/com/cflint/tests/VarScoper/cfloop_index_413.cfc new file mode 100644 index 000000000..83f1aad86 --- /dev/null +++ b/src/test/resources/com/cflint/tests/VarScoper/cfloop_index_413.cfc @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/src/test/resources/com/cflint/tests/VarScoper/cfloop_index_413.expected.txt b/src/test/resources/com/cflint/tests/VarScoper/cfloop_index_413.expected.txt new file mode 100644 index 000000000..68330d7c1 --- /dev/null +++ b/src/test/resources/com/cflint/tests/VarScoper/cfloop_index_413.expected.txt @@ -0,0 +1,49 @@ +{ + "version" : "", + "timestamp" : 0, + "issues" : [ { + "severity" : "ERROR", + "id" : "MISSING_VAR", + "message" : "MISSING_VAR", + "category" : "CFLINT", + "abbrev" : "MV", + "locations" : [ { + "file" : "src/test/resources/com/cflint/tests/VarScoper/cfloop_index_413.cfc", + "fileName" : "cfloop_index_413.cfc", + "function" : "foo", + "column" : 2, + "line" : 2, + "message" : "Variable idx is not declared with a var statement.", + "variable" : "idx", + "expression" : "idx" + } ] + }, { + "severity" : "ERROR", + "id" : "MISSING_VAR", + "message" : "MISSING_VAR", + "category" : "CFLINT", + "abbrev" : "MV", + "locations" : [ { + "file" : "src/test/resources/com/cflint/tests/VarScoper/cfloop_index_413.cfc", + "fileName" : "cfloop_index_413.cfc", + "function" : "foo", + "column" : 3, + "line" : 3, + "message" : "Variable xxx is not declared with a var statement.", + "variable" : "xxx", + "expression" : "xxx" + } ] + } ], + "counts" : { + "totalFiles" : 0, + "totalLines" : 0, + "countByCode" : [ { + "code" : "MISSING_VAR", + "count" : 2 + } ], + "countBySeverity" : [ { + "severity" : "ERROR", + "count" : 2 + } ] + } +} \ No newline at end of file diff --git a/src/test/resources/com/cflint/tests/VarScoper/cfquery_scoper.expected.txt b/src/test/resources/com/cflint/tests/VarScoper/cfquery_scoper.expected.txt index 1c2ba4312..400f84b38 100644 --- a/src/test/resources/com/cflint/tests/VarScoper/cfquery_scoper.expected.txt +++ b/src/test/resources/com/cflint/tests/VarScoper/cfquery_scoper.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202135", + "timestamp" : 1501392731, "issues" : [ { "severity" : "ERROR", "id" : "MISSING_VAR", diff --git a/src/test/resources/com/cflint/tests/VarScoper/cftry.expected.txt b/src/test/resources/com/cflint/tests/VarScoper/cftry.expected.txt index 5303b7de5..acc9080e2 100644 --- a/src/test/resources/com/cflint/tests/VarScoper/cftry.expected.txt +++ b/src/test/resources/com/cflint/tests/VarScoper/cftry.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202135", + "timestamp" : 1501392731, "issues" : [ { "severity" : "ERROR", "id" : "MISSING_VAR", diff --git a/src/test/resources/com/cflint/tests/VarScoper/for_each.cfc b/src/test/resources/com/cflint/tests/VarScoper/for_each.cfc new file mode 100644 index 000000000..e82c96fd7 --- /dev/null +++ b/src/test/resources/com/cflint/tests/VarScoper/for_each.cfc @@ -0,0 +1,7 @@ +component{ +function ffoo(any XSS){ + For (Fixeld in Arguments.XSS) { + foo(); + } +} +} \ No newline at end of file diff --git a/src/test/resources/com/cflint/tests/VarScoper/for_each.expected.txt b/src/test/resources/com/cflint/tests/VarScoper/for_each.expected.txt new file mode 100644 index 000000000..6ee2df8e9 --- /dev/null +++ b/src/test/resources/com/cflint/tests/VarScoper/for_each.expected.txt @@ -0,0 +1,33 @@ +{ + "version" : "", + "timestamp" : 0, + "issues" : [ { + "severity" : "ERROR", + "id" : "MISSING_VAR", + "message" : "MISSING_VAR", + "category" : "CFLINT", + "abbrev" : "MV", + "locations" : [ { + "file" : "src/test/resources/com/cflint/tests/VarScoper/for_each.cfc", + "fileName" : "for_each.cfc", + "function" : "ffoo", + "column" : 9, + "line" : 3, + "message" : "Variable Fixeld is not declared with a var statement.", + "variable" : "Fixeld", + "expression" : "Fixeld" + } ] + } ], + "counts" : { + "totalFiles" : 0, + "totalLines" : 0, + "countByCode" : [ { + "code" : "MISSING_VAR", + "count" : 1 + } ], + "countBySeverity" : [ { + "severity" : "ERROR", + "count" : 1 + } ] + } +} \ No newline at end of file diff --git a/src/test/resources/com/cflint/tests/VarScoper/local_256.expected.txt b/src/test/resources/com/cflint/tests/VarScoper/local_256.expected.txt index 3f6957f52..67fc27f12 100644 --- a/src/test/resources/com/cflint/tests/VarScoper/local_256.expected.txt +++ b/src/test/resources/com/cflint/tests/VarScoper/local_256.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202135", + "timestamp" : 1501392732, "issues" : [ ], "counts" : { "totalFiles" : 0, diff --git a/src/test/resources/com/cflint/tests/VarScoper/namedArgs.expected.txt b/src/test/resources/com/cflint/tests/VarScoper/namedArgs.expected.txt index fd27cd90b..67fc27f12 100644 --- a/src/test/resources/com/cflint/tests/VarScoper/namedArgs.expected.txt +++ b/src/test/resources/com/cflint/tests/VarScoper/namedArgs.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202136", + "timestamp" : 1501392732, "issues" : [ ], "counts" : { "totalFiles" : 0, diff --git a/src/test/resources/com/cflint/tests/VarScoper/property_246.expected.txt b/src/test/resources/com/cflint/tests/VarScoper/property_246.expected.txt index fd27cd90b..67fc27f12 100644 --- a/src/test/resources/com/cflint/tests/VarScoper/property_246.expected.txt +++ b/src/test/resources/com/cflint/tests/VarScoper/property_246.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202136", + "timestamp" : 1501392732, "issues" : [ ], "counts" : { "totalFiles" : 0, diff --git a/src/test/resources/com/cflint/tests/VarScoper/pureScript.expected.txt b/src/test/resources/com/cflint/tests/VarScoper/pureScript.expected.txt index fb64346e7..c9dcbef16 100644 --- a/src/test/resources/com/cflint/tests/VarScoper/pureScript.expected.txt +++ b/src/test/resources/com/cflint/tests/VarScoper/pureScript.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202136", + "timestamp" : 1501392732, "issues" : [ { "severity" : "ERROR", "id" : "MISSING_VAR", diff --git a/src/test/resources/com/cflint/tests/VarScoper/scriptSample186.expected.txt b/src/test/resources/com/cflint/tests/VarScoper/scriptSample186.expected.txt index 18acc08d6..9234eb49c 100644 --- a/src/test/resources/com/cflint/tests/VarScoper/scriptSample186.expected.txt +++ b/src/test/resources/com/cflint/tests/VarScoper/scriptSample186.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202136", + "timestamp" : 1501392733, "issues" : [ { "severity" : "ERROR", "id" : "MISSING_VAR", diff --git a/src/test/resources/com/cflint/tests/VarScoper/structassignment.expected.txt b/src/test/resources/com/cflint/tests/VarScoper/structassignment.expected.txt index fd27cd90b..8db662dc9 100644 --- a/src/test/resources/com/cflint/tests/VarScoper/structassignment.expected.txt +++ b/src/test/resources/com/cflint/tests/VarScoper/structassignment.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202136", + "timestamp" : 1501392733, "issues" : [ ], "counts" : { "totalFiles" : 0, diff --git a/src/test/resources/com/cflint/tests/VarScoper/structureKeys_197.expected.txt b/src/test/resources/com/cflint/tests/VarScoper/structureKeys_197.expected.txt index fd27cd90b..8db662dc9 100644 --- a/src/test/resources/com/cflint/tests/VarScoper/structureKeys_197.expected.txt +++ b/src/test/resources/com/cflint/tests/VarScoper/structureKeys_197.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202136", + "timestamp" : 1501392733, "issues" : [ ], "counts" : { "totalFiles" : 0, diff --git a/src/test/resources/com/cflint/tests/VarScoper/structure_keys_197.expected.txt b/src/test/resources/com/cflint/tests/VarScoper/structure_keys_197.expected.txt index fd27cd90b..8db662dc9 100644 --- a/src/test/resources/com/cflint/tests/VarScoper/structure_keys_197.expected.txt +++ b/src/test/resources/com/cflint/tests/VarScoper/structure_keys_197.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202136", + "timestamp" : 1501392733, "issues" : [ ], "counts" : { "totalFiles" : 0, diff --git a/src/test/resources/com/cflint/tests/VarScoper/testParse.expected.txt b/src/test/resources/com/cflint/tests/VarScoper/testParse.expected.txt index fd27cd90b..8db662dc9 100644 --- a/src/test/resources/com/cflint/tests/VarScoper/testParse.expected.txt +++ b/src/test/resources/com/cflint/tests/VarScoper/testParse.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202136", + "timestamp" : 1501392733, "issues" : [ ], "counts" : { "totalFiles" : 0, diff --git a/src/test/resources/com/cflint/tests/VariableNameChecker/cftry.expected.txt b/src/test/resources/com/cflint/tests/VariableNameChecker/cftry.expected.txt index add0776e9..f4a90097f 100644 --- a/src/test/resources/com/cflint/tests/VariableNameChecker/cftry.expected.txt +++ b/src/test/resources/com/cflint/tests/VariableNameChecker/cftry.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202135", + "timestamp" : 1501392730, "issues" : [ { "severity" : "INFO", "id" : "VAR_TOO_LONG", diff --git a/src/test/resources/com/cflint/tests/VariableNameChecker/sample1_228.expected.txt b/src/test/resources/com/cflint/tests/VariableNameChecker/sample1_228.expected.txt index 05f93f9d6..877ddcca0 100644 --- a/src/test/resources/com/cflint/tests/VariableNameChecker/sample1_228.expected.txt +++ b/src/test/resources/com/cflint/tests/VariableNameChecker/sample1_228.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202135", + "timestamp" : 1501392731, "issues" : [ { "severity" : "INFO", "id" : "VAR_INVALID_NAME", diff --git a/src/test/resources/com/cflint/tests/VariableNameChecker/sample_239.expected.txt b/src/test/resources/com/cflint/tests/VariableNameChecker/sample_239.expected.txt index 3f6957f52..6594dfbc4 100644 --- a/src/test/resources/com/cflint/tests/VariableNameChecker/sample_239.expected.txt +++ b/src/test/resources/com/cflint/tests/VariableNameChecker/sample_239.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202135", + "timestamp" : 1501392731, "issues" : [ ], "counts" : { "totalFiles" : 0, diff --git a/src/test/resources/com/cflint/tests/WriteDumpChecker/writeDump.expected.txt b/src/test/resources/com/cflint/tests/WriteDumpChecker/writeDump.expected.txt index d4da230c6..c825282c7 100644 --- a/src/test/resources/com/cflint/tests/WriteDumpChecker/writeDump.expected.txt +++ b/src/test/resources/com/cflint/tests/WriteDumpChecker/writeDump.expected.txt @@ -1,6 +1,6 @@ { "version" : "", - "timestamp" : "1501202137", + "timestamp" : 1501392733, "issues" : [ { "severity" : "INFO", "id" : "AVOID_USING_WRITEDUMP",