-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathcodeclimate.cfc
More file actions
31 lines (31 loc) · 1.12 KB
/
codeclimate.cfc
File metadata and controls
31 lines (31 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
component {
any function format(required array results, filesystemUtil) {
var categoryMap = {
'Case Sensitive Functions - Best Practices': ['Compatibility'],
'Formatting Functions - Best Practices': ['Style'],
'Maintenance': ['Complexity', 'Clarity'],
'Performance': ['Performance'],
'QueryParamScanner': ['Security'],
'Security Risks - Best Practices': ['Security'],
'Standards': ['Clarity'],
'VarScoper': ['Performance', 'Security'],
}
var severityLabel=['info', 'minor', 'major', 'critical', 'blocker'];
return results.map(function(result) {
return {
'type': 'issue',
'description': result.message,
'check_name': result.rule,
'severity': severityLabel[result.severity],
'categories': (categoryMap[result.category]?:[result.category]),
'location': {
'path': replace(result.directory & result.file, filesystemUtil.resolvePath(''), ''),
'lines': {
'begin': result.lineNumber
}
},
'fingerprint': hash('#replace(result.directory & result.file, filesystemUtil.resolvePath(''), '')#:#result.lineNumber#@#result.severity#!#result.rule#', 'md5')
};
} );
}
}