Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit90be5c5

Browse files
committed
Revamped approach based on Apex work
1 parent9dcd279 commit90be5c5

10 files changed

+869
-224
lines changed

‎.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.DS_Store

‎apex-ruleset.xml

Lines changed: 0 additions & 206 deletions
This file was deleted.

‎engine.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
2-
"name":"codeclimate-apexmetrics",
3-
"description":"Static code analysis tool forSalesforce.com Apex based on PMD",
2+
"name":"codeclimate-pmd",
3+
"description":"Static code analysis tool forJava",
44
"maintainer": {
5-
"name":"Up2go-DavidRenz",
6-
"email":"david.renz@up2go.com"
5+
"name":"sivakumar-kailasam",
6+
"email":"sivakumar.ur.friend@gmail.com"
77
},
88
"languages": [
9-
"Apex"
9+
"Java"
1010
],
1111
"version":"1.0.0"
12-
}
12+
}
Binary file not shown.
Binary file not shown.
-133 KB
Binary file not shown.
1.86 KB
Binary file not shown.
728 KB
Binary file not shown.

‎pmd.groovy

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,17 @@ import groovy.util.FileNameFinder
44

55

66
def appContext= setupContext(args)
7-
def includePaths=newJsonSlurper().parse(newFile(appContext.configFile),"UTF-8").include_paths?.join("")
7+
def parsedConfig=newJsonSlurper().parse(newFile(appContext.configFile),"UTF-8")
8+
9+
def includePaths= parsedConfig.include_paths?.join("")
810
def codeFolder=newFile(appContext.codeFolder)
911

1012
def filesToAnalyse=newFileNameFinder().getFileNames(appContext.codeFolder, includePaths)
1113

1214
def i= filesToAnalyse.iterator()
1315
while(i.hasNext()) {
1416
string= i.next()
15-
if(!string.endsWith(".cls")&&!string.endsWith(".trigger") ) {
17+
if(!string.endsWith(".java") ) {
1618
i.remove()
1719
}
1820
}
@@ -23,17 +25,14 @@ if (filesToAnalyse.isEmpty()) {
2325
System.exit(0)
2426
}
2527

26-
def ruleset
27-
def defaultRulesetLocation="/usr/src/app/apex-ruleset.xml"
28-
def customRulesetLocation="/code/apex-ruleset.xml"
29-
if (newFile(customRulesetLocation).exists() ) {
30-
ruleset= customRulesetLocation
31-
}
32-
else {
33-
ruleset= defaultRulesetLocation
28+
def ruleSetPath
29+
if (newFile(parsedConfig.config).exists() ) {
30+
ruleSetPath= parsedConfig.config
31+
}else {
32+
ruleSetPath="/usr/src/app/ruleset.xml"
3433
}
3534

36-
def pmdCommand="/usr/src/app/lib/pmd/bin/run.sh pmd -d${filesToAnalyse} -f codeclimate -R${ruleset} -l apex -v 35 -failOnViolation false"
35+
def pmdCommand="/usr/src/app/lib/pmd/bin/run.sh pmd -d${filesToAnalyse} -f codeclimate -R${ruleSetPath} -v 35 -failOnViolation false"
3736

3837
ProcessBuilder builder=newProcessBuilder( pmdCommand.split('') )
3938

@@ -54,7 +53,6 @@ if ( process.exitValue() != 0 ) {
5453

5554
System.exit(0)
5655

57-
5856
defsetupContext(cmdArgs) {
5957
def cli=newCliBuilder(usage:"${this.class.name}")
6058
cli._(longOpt:"configFile",required:true,args:1,"Path to config.json file")

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp