Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Rule to check for incorrect name attribute on component #81

Closed
wants to merge 34 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift click to select a range
e9994e4
#62
jjames967 Aug 17, 2015
e1e3224
#67
jjames967 Aug 17, 2015
8cb7876
#67
jjames967 Aug 17, 2015
59ae0fb
Rule to check for missing types and any types in function arguments.
justinmclean Sep 28, 2015
aa0f884
Tests for argument checker.
justinmclean Sep 28, 2015
9a2a420
Remove debug statements
justinmclean Sep 28, 2015
4e7717f
Merge pull request #73 from justinmclean/argchecker
justinmclean Sep 29, 2015
4c4647b
Merge commit 'a9687d3a1ad3941a0577cd92cb6ae866a0ee818e' into dev
justinmclean Sep 29, 2015
86afede
Added length parameter to function length checker. Fixed up function …
justinmclean Sep 29, 2015
0f5e24b
May need access to function name while in cffunction tag
justinmclean Sep 29, 2015
50b9d77
Add function name to rule message.
justinmclean Sep 29, 2015
10a0dbb
Added component length checker rule.
justinmclean Sep 29, 2015
7b697dd
Added rule to check function return type exists or is any
justinmclean Sep 30, 2015
84b88f3
Tests for function return type
justinmclean Sep 30, 2015
b005564
Fix for broken build?
justinmclean Sep 30, 2015
e8383ff
Merge pull request #74 from cflint/functionreturntype
justinmclean Oct 4, 2015
63a4888
update tests adding hints to components
justinmclean Oct 4, 2015
bf4319e
turn new rules on by default
justinmclean Oct 4, 2015
a01e1db
Added counts of each error type.
justinmclean Oct 5, 2015
29abb3e
Give more reasonable values for lengths
justinmclean Oct 5, 2015
333d337
Add BSD license text
justinmclean Oct 6, 2015
22a55c1
Merge pull request #75 from cflint/summary
justinmclean Oct 6, 2015
8735077
Tests for too many functions
justinmclean Oct 6, 2015
16b287d
Rule for too many functions.
justinmclean Oct 6, 2015
2cf0b86
Don't count trivial functions and reset count when starting a component.
justinmclean Oct 6, 2015
300427f
Gradle Deployment #80
jerronjames Oct 6, 2015
cccab97
fix plugin name
justinmclean Oct 6, 2015
e3889ad
Update TooManyFunctionsChecker.java
ryaneberly Oct 6, 2015
fcf24aa
Merge pull request #79 from cflint/toomanyfunctions
justinmclean Oct 6, 2015
f46cc59
Gradle Deployment #80
jjames967 Oct 7, 2015
7db86d8
Gradle Deployment #80
jjames967 Oct 7, 2015
94b8a90
Gradle Deployment #80
jjames967 Oct 7, 2015
cce6798
Tests to check for incorrect name attribute on component
justinmclean Oct 7, 2015
5a29bbb
Rule to check for incorrect name attribute on component
justinmclean Oct 7, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 4,5 @@
/.classpath
/.project
/.settings/
.gradle/**/*
/build
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1 1,4 @@
language: java

before_install:
- chmod x gradlew
24 changes: 24 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 1,24 @@
Copyright (c) 2015, CFLint
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the CFLint nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
56 changes: 56 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 1,56 @@
buildscript {
repositories {
mavenLocal()
jcenter {
url "http://jcenter.bintray.com/"
}
maven { url "http://oss.sonatype.org/content/repositories/snapshots/" }
}
dependencies {
classpath 'com.bmuschko:gradle-nexus-plugin:2.3'
classpath "io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.5.3"
}
}

plugins {
id 'java'
id 'com.github.johnrengelman.shadow' version '1.2.2'
}

apply plugin: "base"
apply plugin: "signing"
apply plugin: "com.bmuschko.nexus"

apply plugin: 'java'
apply plugin: 'maven'
apply from: 'cobertura.gradle'
apply from: 'deploy.gradle'

sourceCompatibility = 1.7
targetCompatibility = 1.7

repositories {
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
maven { url "http://repo.maven.apache.org/maven2" }
}
dependencies {
compile group: 'com.github.cfparser', name: 'cfparser', version:'2.0.0'
compile group: 'com.github.cfparser', name: 'cfml.parsing', version:'2.0.0'
compile group: 'com.github.cfparser', name: 'cfml.dictionary', version:'2.0.0'
compile group: 'junit', name: 'junit', version:'4.11'
compile group: 'com.googlecode.json-simple', name: 'json-simple', version:'1.1'
compile group: 'org.jdom', name: 'jdom', version:'1.1.3'
compile group: 'org.antlr', name: 'antlr4-runtime', version:'4.5'
compile group: 'org.antlr', name: 'stringtemplate', version:'4.0.2'
compile group: 'org.antlr', name: 'antlr4', version:'4.5'
compile group: 'net.htmlparser.jericho', name: 'jericho-html', version:'3.3'
compile group: 'log4j', name: 'log4j', version:'1.2.17'
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'
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'
}
51 changes: 51 additions & 0 deletions cobertura.gradle
Original file line number Diff line number Diff line change
@@ -0,0 1,51 @@
logger.info "Configuring Cobertura Plugin"

configurations{
coberturaRuntime {extendsFrom testRuntime}
}

dependencies {
coberturaRuntime 'net.sourceforge.cobertura:cobertura:1.9.4'
}

def serFile="${project.buildDir}/cobertura.ser"
def classes="${project.buildDir}/classes/main"
def classesCopy="${classes}-copy"


task cobertura(type: Test){
dependencies {
testRuntime 'net.sourceforge.cobertura:cobertura:1.9.4'
}

systemProperty "net.sourceforge.cobertura.datafile", serFile
}

cobertura.doFirst {
logger.quiet "Instrumenting classes for Cobertura"
ant {
delete(file:serFile, failonerror:false)
delete(dir: classesCopy, failonerror:false)
copy(todir: classesCopy) { fileset(dir: classes) }

taskdef(resource:'tasks.properties', classpath: configurations.coberturaRuntime.asPath)
'cobertura-instrument'(datafile: serFile) {
fileset(dir: classes,
includes:"**/*.class",
excludes:"**/*Test.class")
}
}
}

cobertura.doLast{
if (new File(classesCopy).exists()) {
//create html cobertura report
ant.'cobertura-report'(destdir:"${project.reportsDir}/cobertura",
format:'html', srcdir:"src/main/java", datafile: serFile)
//create xml cobertura report
ant.'cobertura-report'(destdir:"${project.reportsDir}/cobertura",
format:'xml', srcdir:"src/main/java", datafile: serFile)
ant.delete(file: classes)
ant.move(file: classesCopy, tofile: classes)
}
}
28 changes: 28 additions & 0 deletions deploy.gradle
Original file line number Diff line number Diff line change
@@ -0,0 1,28 @@
configurations {
jaxDoclet
}

nexus {
sign = true
repositoryUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
snapshotRepositoryUrl = 'https://oss.sonatype.org/content/repositories/snapshots/'
}

task deploy() {
if (release.toBoolean() == true) {
def strippedSnapshotVersion = version.replaceFirst(/-SNAPSHOT/, '')
ant.propertyfile(file: "gradle.properties") {
entry( key: "version", value: "$strippedSnapshotVersion")
entry( key: "release", value: "false")
}
}
else if (snapshot.toBoolean() == true) {
def strippedSnapshotVersion = version.replaceFirst(/-SNAPSHOT/, '')
ant.propertyfile(file: "gradle.properties") {
entry( key: "version", value: "$strippedSnapshotVersion-SNAPSHOT")
entry( key: "snapshot", value: "false")
}
}
}

uploadArchives.mustRunAfter deploy
6 changes: 6 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 1,6 @@
#Tue, 06 Oct 2015 20:08:05 -0600
group=com.github.cflint
version=0.5.0
name=CFLint
release=false
snapshot=false
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
6 changes: 6 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 1,6 @@
#Sun Aug 16 19:51:35 MDT 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-bin.zip
164 changes: 164 additions & 0 deletions gradlew
Original file line number Diff line number Diff line change
@@ -0,0 1,164 @@
#!/usr/bin/env bash

##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""

APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"

warn ( ) {
echo "$*"
}

die ( ) {
echo
echo "$*"
echo
exit 1
}

# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
esac

# For Cygwin, ensure paths are in UNIX format before anything is touched.
if $cygwin ; then
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
fi

# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >&-
APP_HOME="`pwd -P`"
cd "$SAVED" >&-

CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar

# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi

# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi

# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi

# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`

# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option

if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i 1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi

# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"

exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
Loading