-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathfile.cfm
49 lines (42 loc) · 1.31 KB
/
file.cfm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<cfparam name="url.directory" default="#expandPath('/')#" />
<cfparam name="url.file" />
<cf_layout title="File Complexity" directory="#url.directory#" file="#url.file#">
<cfset complexityReport = application.complexity.getFileComplexityReport(url.file) />
<cfoutput>
<h2>File #url.file#</h2>
<h3>Overall File Complexity: #complexityReport.getBasicComplexityCount()#</h3>
</cfoutput>
<cfif complexityReport.hasFunctions()>
<cfset functions = complexityReport.getFunctions() />
<table class="functions">
<thead>
<tr>
<td>Function Name</td>
<td>Lines</td>
<td>Complexity</td>
</tr>
</thead>
<tbody>
<cfoutput query="functions">
<tr>
<td><a href="function.cfm?directory=#url.directory#&file=#url.file#&function=#name#" class="mono b">#name# ()</a></td>
<td>#Lines#</td>
<td>#complexity#</td>
</tr>
</cfoutput>
</tbody>
</table>
<script type="text/javascript">
$("table.functions tbody tr").colorFade(function(){
return parseInt($(this).find("td:last").html());
}, function(){
return $(this);//.find("td:last");
});
</script>
<cfelse>
<h5>No Functions</h5>
</cfif>
<cfif complexityReport.hasLineByLineDetails()>
<cf_displaycomplexitycode contentComplexity="#complexityReport.getLineByLineDetails()#" />
</cfif>
</cf_layout>