kwala 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. data/README +62 -0
  2. data/bin/kwala +39 -0
  3. data/lib/kwala.rb +59 -0
  4. data/lib/kwala/actions/code_change.rb +128 -0
  5. data/lib/kwala/actions/code_coverage.rb +303 -0
  6. data/lib/kwala/actions/code_duplication.rb +222 -0
  7. data/lib/kwala/actions/code_formatting.rb +358 -0
  8. data/lib/kwala/actions/cycle_detection.rb +118 -0
  9. data/lib/kwala/actions/cyclomatic_complexity.rb +159 -0
  10. data/lib/kwala/actions/dead_code.rb +68 -0
  11. data/lib/kwala/actions/executable_files_check.rb +111 -0
  12. data/lib/kwala/actions/flagged_comments.rb +128 -0
  13. data/lib/kwala/actions/gem_plugin.rb +31 -0
  14. data/lib/kwala/actions/loc_count.rb +153 -0
  15. data/lib/kwala/actions/multi_ruby_unit_test.rb +62 -0
  16. data/lib/kwala/actions/outside_links.rb +85 -0
  17. data/lib/kwala/actions/rails_migrate.rb +62 -0
  18. data/lib/kwala/actions/strange_requires.rb +106 -0
  19. data/lib/kwala/actions/syntax_check.rb +130 -0
  20. data/lib/kwala/actions/unit_test.rb +368 -0
  21. data/lib/kwala/build_action.rb +88 -0
  22. data/lib/kwala/build_context.rb +49 -0
  23. data/lib/kwala/command_line_runner.rb +184 -0
  24. data/lib/kwala/ext/demos.jar +0 -0
  25. data/lib/kwala/ext/pmd.jar +0 -0
  26. data/lib/kwala/ext/prefuse.jar +0 -0
  27. data/lib/kwala/extensions.rb +36 -0
  28. data/lib/kwala/lib/code_analyzer.rb +678 -0
  29. data/lib/kwala/lib/cycle_detector.rb +793 -0
  30. data/lib/kwala/lib/strange_requires_detector.rb +145 -0
  31. data/lib/kwala/notification.rb +45 -0
  32. data/lib/kwala/notifications/email.rb +54 -0
  33. data/lib/kwala/notifications/rss.rb +151 -0
  34. data/lib/kwala/project_builder_utils.rb +178 -0
  35. data/lib/kwala/templates/build_template.html +33 -0
  36. data/lib/kwala/templates/code_change_summary.html +27 -0
  37. data/lib/kwala/templates/code_coverage_detailed.html +25 -0
  38. data/lib/kwala/templates/code_coverage_summary.html +30 -0
  39. data/lib/kwala/templates/code_duplication_detailed.html +45 -0
  40. data/lib/kwala/templates/code_duplication_summary.html +9 -0
  41. data/lib/kwala/templates/code_formatting_detailed.html +27 -0
  42. data/lib/kwala/templates/code_formatting_summary.html +11 -0
  43. data/lib/kwala/templates/cycle_detection_detailed.html +20 -0
  44. data/lib/kwala/templates/cycle_detection_summary.html +7 -0
  45. data/lib/kwala/templates/cyclomatic_complexity_summary.html +27 -0
  46. data/lib/kwala/templates/executable_files_check_detailed.html +31 -0
  47. data/lib/kwala/templates/executable_files_check_summary.html +20 -0
  48. data/lib/kwala/templates/flagged_comments_detailed.html +22 -0
  49. data/lib/kwala/templates/flagged_comments_summary.html +10 -0
  50. data/lib/kwala/templates/loc_count_detailed.html +24 -0
  51. data/lib/kwala/templates/loc_count_summary.html +14 -0
  52. data/lib/kwala/templates/mdd/1.png +0 -0
  53. data/lib/kwala/templates/mdd/2.png +0 -0
  54. data/lib/kwala/templates/mdd/3.png +0 -0
  55. data/lib/kwala/templates/mdd/4.png +0 -0
  56. data/lib/kwala/templates/mdd/5.png +0 -0
  57. data/lib/kwala/templates/outside_links_summary.html +4 -0
  58. data/lib/kwala/templates/strange_requires_detailed.html +23 -0
  59. data/lib/kwala/templates/strange_requires_summary.html +13 -0
  60. data/lib/kwala/templates/style.css +95 -0
  61. data/lib/kwala/templates/syntax_check_detailed.html +21 -0
  62. data/lib/kwala/templates/syntax_check_summary.html +7 -0
  63. data/lib/kwala/templates/unit_test_detailed.html +66 -0
  64. data/lib/kwala/templates/unit_test_summary.html +70 -0
  65. data/test/tc_build_action.rb +32 -0
  66. data/test/tc_templates.rb +24 -0
  67. metadata +118 -0
@@ -0,0 +1,33 @@
1
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
+ <html>
3
+ <head>
4
+ <title>Kwala : <span id="project_name"></span> Build Results <span id="build_date"></span></title>
5
+ <link rel="stylesheet" type="text/css" href="style.css"/>
6
+ </head>
7
+
8
+ <body>
9
+ <h1><span id="project_name"></span> Build Results <span id="build_date"></span></h1>
10
+ <div id="vcs">
11
+ <h2>SVN REV : <span id="vcs_num"></span></h2>
12
+ <div>SVN INFO : <pre id="vcs_info"></pre></div>
13
+ </div>
14
+ <h2>Build Times</h2>
15
+ <div>
16
+ <table>
17
+ <tr><td>Started at : </td><td id="build_date"></td></tr>
18
+ <tr><td>Completed at : </td><td id="complete_time"></td></tr>
19
+ <tr><td>Total build time in minutes : </td><td id="total_build_time"></td></tr>
20
+ </table>
21
+ </div>
22
+ <div style="right:0px; position:absolute; top:0px;">
23
+ <div>
24
+ <img width="125" height="150" id="mdd" />
25
+ </div>
26
+ </div>
27
+ <hr>
28
+ <div id="action_summaries">
29
+ <div id="summary"></div>
30
+ <hr>
31
+ </div>
32
+ </body>
33
+ </html>
@@ -0,0 +1,27 @@
1
+ <h2>Code Changes</h2>
2
+ <div id="code_change_results">
3
+ <table width="100%" border="2" id="new_classes">
4
+ <tr><th>New Classes</th></tr>
5
+ <tr id="item"><td id="name"></td></tr>
6
+ </table>
7
+ <table width="100%" border="2" id="removed_classes">
8
+ <tr><th>Removed Classes</th></tr>
9
+ <tr id="item"><td id="name"></td></tr>
10
+ </table>
11
+ <table width="100%" border="2" id="new_class_methods">
12
+ <tr><th>New Class Methods</th></tr>
13
+ <tr id="item"><td id="name"></td></tr>
14
+ </table>
15
+ <table width="100%" border="2" id="removed_class_methods">
16
+ <tr><th>Removed Class Methods</th></tr>
17
+ <tr id="item"><td id="name"></td></tr>
18
+ </table>
19
+ <table width="100%" border="2" id="new_instance_methods">
20
+ <tr><th>New Instance Methods</th></tr>
21
+ <tr id="item"><td id="name"></td></tr>
22
+ </table>
23
+ <table width="100%" border="2" id="removed_instance_methods">
24
+ <tr><th>Removed Instance Methods</th></tr>
25
+ <tr id="item"><td id="name"></td></tr>
26
+ </table>
27
+ </div>
@@ -0,0 +1,25 @@
1
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
+ <html>
3
+ <head>
4
+ <title><span id="project_name"></span> Code Coverage Details <span id="build_date"></span></title>
5
+ <link rel="stylesheet" type="text/css" href="style.css"/>
6
+ </head>
7
+
8
+ <body>
9
+ <h1><span id="project_name"></span> Code Coverage Details <span id="build_date"></span></h1>
10
+ <div id="code_coverage_details">
11
+ <table border="2">
12
+ <tr><th>Code coverage</th>
13
+ <th>Non covered LOC</th>
14
+ <th>Lines Of Code</th>
15
+ <th>File</th></tr>
16
+ <tr id="entry">
17
+ <td id="result"></td>
18
+ <td id="nloc"></td>
19
+ <td id="loc"></td>
20
+ <td id="file"></td>
21
+ </tr>
22
+ </table>
23
+ </div>
24
+ </body>
25
+ </html>
@@ -0,0 +1,30 @@
1
+ <h2><span id="code_coverage_details"></span></h2>
2
+ <div id="code_coverage_results">
3
+ <table border="2">
4
+ <tr>
5
+ <td>Global coverage:<br>(weighted by Lines of Code)</td>
6
+ <td><b><big><span id="global_cov"></span> %</big></b></td>
7
+ </tr>
8
+ <tr>
9
+ <td>Test files count</td>
10
+ <td><span id="c_num"></span></td>
11
+ </tr>
12
+ </table>
13
+ </div>
14
+
15
+ <div id="code_coverage_summary">
16
+ <table border="2">
17
+ <tr>
18
+ <th>Code coverage</th>
19
+ <th>Non covered LOC</th>
20
+ <th>Lines Of Code</th>
21
+ <th>File</th>
22
+ </tr>
23
+ <tr id="entry">
24
+ <td id="result"></td>
25
+ <td id="nloc"></td>
26
+ <td id="loc"></td>
27
+ <td id="file"></td>
28
+ </tr>
29
+ </table>
30
+ </div>
@@ -0,0 +1,45 @@
1
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
+ <html>
3
+ <head>
4
+ <title><span id="project_name"></span> Code Duplication Results <span id="build_date"></span></title>
5
+ <link rel="stylesheet" type="text/css" href="style.css"/>
6
+ </head>
7
+
8
+ <body>
9
+ <h1><span id="project_name"></span> Code Duplication Results <span id="build_date"></span></h1>
10
+ <span>
11
+ <span id="duplicate_refs"><a id="entry_num"></a></span>
12
+ </span>
13
+ <hr>
14
+ <div id="duplicates">
15
+ <div id="duplicate">
16
+ <h3>Dup #<a id="entry_num"></a>
17
+ <div style="float:right; margin-top: -20px">
18
+ <a id="prev_entry_num"></a>&nbsp;&nbsp;
19
+ <a id="next_entry_num"></a>
20
+ </div>
21
+ </h3>
22
+ <table width="100%" border="2">
23
+ <tr><th>Duplicate Tokens</th><th>Lines</th>
24
+ </tr>
25
+ <tr>
26
+ <td id="tokens"></td>
27
+ <td id="lines"></td>
28
+ </tr>
29
+ <tr>
30
+ <table width="100%" border="1">
31
+ <tr><th>File Path</th><th>Line #</th></tr>
32
+ <tr id="files">
33
+ <td id="path"></td>
34
+ <td id="line"></td>
35
+ </tr>
36
+ </table>
37
+ </tr>
38
+ </table>
39
+ <pre style="background-color:black;color:silver;" id="code_fragement">
40
+ </pre>
41
+ </div>
42
+ </div>
43
+ <hr>
44
+ </body>
45
+ </html>
@@ -0,0 +1,9 @@
1
+ <h2><span id="code_duplication_details"></span></h2>
2
+ <div id="duplicate_code_results">
3
+ <table border=1>
4
+ <tr>
5
+ <td>Duplicate Code Count : </td>
6
+ <td id="duplicate_count"></td>
7
+ </tr>
8
+ </table>
9
+ </div>
@@ -0,0 +1,27 @@
1
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
+ <html>
3
+ <head>
4
+ <title><span id="project_name"></span> Code Formatting Details <span id="build_date"></span></title>
5
+ <link rel="stylesheet" type="text/css" href="style.css"/>
6
+ </head>
7
+
8
+ <body>
9
+ <h1><span id="project_name"></span> Code Formatting Details <span id="build_date"></span></h1>
10
+ <div id="code_formatting_details">
11
+ <table width="100%" border="2">
12
+ <tr>
13
+ <th>File</th>
14
+ <th>Type</th>
15
+ <th>Line #</th>
16
+ <th>Line inspect</th>
17
+ </tr>
18
+ <tr id="entry">
19
+ <td id="file"></td>
20
+ <td id="type"></td>
21
+ <td id="line_num"></td>
22
+ <td id="line"></td>
23
+ </tr>
24
+ </table>
25
+ </div>
26
+ </body>
27
+ </html>
@@ -0,0 +1,11 @@
1
+ <h2><a id="code_formatting_details">Code Formatting Details</a></h2>
2
+ <div id="code_formatting_results">
3
+ <table width="100%" border="2">
4
+ <tr>
5
+ <th id="headers"></th>
6
+ </tr>
7
+ <tr>
8
+ <td id="values"></td>
9
+ </tr>
10
+ </table>
11
+ </div>
@@ -0,0 +1,20 @@
1
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
+ <html>
3
+ <head>
4
+ <title><span id="project_name"></span> Syntax Check Results <span id="build_date"></span></title>
5
+ <link rel="stylesheet" type="text/css" href="style.css"/>
6
+ </head>
7
+
8
+ <body>
9
+ <h1><span id="project_name"></span> Require Graph <span id="build_date"></span></h1>
10
+ <!-- <applet code="prefuse.demos.applets.RadialGraphView.class" -->
11
+ <applet code="prefuse.demos.applets.GraphView.class"
12
+ archive="demos.jar,prefuse.jar"
13
+ width="1000" height="1000">
14
+ <param name="XML" value="require_graph.xml">
15
+ <param name="NodeName" value="name">
16
+ If you can read this text, the applet is not working. Perhaps you don't
17
+ have the Java 1.4.2 (or later) web plug-in installed?
18
+ </applet>
19
+ </body>
20
+ </html>
@@ -0,0 +1,7 @@
1
+ <h2><span id="cycle_details"></span></h2>
2
+ <div id="cycle_results">
3
+ <table width="100%" border="2">
4
+ <tr><th>Cycle</th><th>Path</th></tr>
5
+ <tr id="entry"><td id="name"></td><td><ul><li id="list"></li></ul></td></tr>
6
+ </table>
7
+ </div>
@@ -0,0 +1,27 @@
1
+ <h2>Saikuro metrics</h2>
2
+ <div id="saikuro_metrics_summary">
3
+ <div>
4
+ <h3 id="cyclo_link">Cyclomatic Complexity Errors and Warnings Details</h3>
5
+ <table border=1>
6
+ <tr><th>Total</th><th>Errors</th><th>Warnings</th></tr>
7
+ <tr id="cyclo_violations">
8
+ <td id="total"></td>
9
+ <td id="errors"></td>
10
+ <td id="warnings"></td>
11
+ </tr>
12
+ </table>
13
+ <div id="cyclo_summary"></div>
14
+ </div>
15
+ <div>
16
+ <h3 id="token_link">Token Count Errors and Warnings Details</h3>
17
+ <table border=1>
18
+ <tr><th>Total</th><th>Errors</th><th>Warnings</th></tr>
19
+ <tr id="token_violations">
20
+ <td id="total"></td>
21
+ <td id="errors"></td>
22
+ <td id="warnings"></td>
23
+ </tr>
24
+ </table>
25
+ <div id="token_summary"></div>
26
+ </div>
27
+ </div>
@@ -0,0 +1,31 @@
1
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
+ <html>
3
+ <head>
4
+ <title><span id="project_name"></span> Executable Files Check <span id="build_date"></span></title>
5
+ <link rel="stylesheet" type="text/css" href="style.css"/>
6
+ </head>
7
+
8
+ <body>
9
+ <h1><span id="project_name"></span> Executable Files Check <span id="build_date"></span></h1>
10
+
11
+ <div id="executable_files_check_results">
12
+ <div id="problem_files">
13
+ <h3>Problem files</h3>
14
+ <table width="100%" border="2">
15
+ <tr><th>File</th><th>Problem</th></tr>
16
+ <tr id="files">
17
+ <td id="filename"></td><td id="problem"></td>
18
+ </tr>
19
+ </table>
20
+ </div>
21
+
22
+ <h3>Ruby files with shell bang</h3>
23
+ <table width="100%" border="2">
24
+ <tr><th>File</th><th>Lines of Code</th><th>Lines of Comments</th><th>Blank Lines</th></tr>
25
+ <tr id="files">
26
+ <td id="filename"></td><td id="lines_of_code"></td>
27
+ </tr>
28
+ </table>
29
+ </div>
30
+ </body>
31
+ </html>
@@ -0,0 +1,20 @@
1
+ <h2><span id="executable_files_check_details"></span></h2>
2
+ <div id="executable_files_check_results">
3
+ <div id="problem_files">
4
+ <h3>Problem files</h3>
5
+ <table width="100%" border="2">
6
+ <tr><th>File</th><th>Problem</th></tr>
7
+ <tr id="files">
8
+ <td id="filename"></td><td id="problem"></td>
9
+ </tr>
10
+ </table>
11
+ </div>
12
+
13
+ <h3>Top 10 lines of code ruby files with shell bang</h3>
14
+ <table width="100%" border="2">
15
+ <tr><th>File</th><th>Lines of Code</th><th>Lines of Comments</th><th>Blank Lines</th></tr>
16
+ <tr id="files">
17
+ <td id="filename"></td><td id="lines_of_code"></td>
18
+ </tr>
19
+ </table>
20
+ </div>
@@ -0,0 +1,22 @@
1
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
+ <html>
3
+ <head>
4
+ <title><span id="project_name"></span> Flagged Comments Details <span id="build_date"></span></title>
5
+ <link rel="stylesheet" type="text/css" href="style.css"/>
6
+ </head>
7
+
8
+ <body>
9
+ <h1><span id="project_name"></span> Flagged Comments Details <span id="build_date"></span></h1>
10
+
11
+ <div id="com_details">
12
+ <div id="entry">
13
+ <h2>Type: <span id="type"></span></h2>
14
+ <h2>Count: <span id="count"></span></h2>
15
+ <table width="100%" border="1">
16
+ <tr><th>File</th><th>Text Summary</th></tr>
17
+ <tr id="entries"><td id="file"></td><td id="txt"></td></tr>
18
+ </table>
19
+ </div>
20
+ </div>
21
+ </body>
22
+ </html>
@@ -0,0 +1,10 @@
1
+ <h2><span id="com_details"></span></h2>
2
+ <div id="com_results">
3
+ <table width="100%" border="2">
4
+ <tr><th>Type</th><th>Count</th></tr>
5
+ <tr id="entry">
6
+ <td id="type"></td>
7
+ <td id="count"></td>
8
+ </tr>
9
+ </table>
10
+ </div>
@@ -0,0 +1,24 @@
1
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
+ <html>
3
+ <head>
4
+ <title><span id="project_name"></span> Lines of Code per File <span id="build_date"></span></title>
5
+ <link rel="stylesheet" type="text/css" href="style.css"/>
6
+ </head>
7
+
8
+ <body>
9
+ <h1><span id="project_name"></span> Lines of Code per File <span id="build_date"></span></h1>
10
+
11
+ <div id="loc_details">
12
+ <table width="100%" border="2">
13
+ <tr><th>File</th><th>Total</th><th>Code</th><th>%</th><th>Comments</th><th>%</th><th>Blank</th><th>%</th></tr>
14
+ <tr id="entry">
15
+ <td id="file"></td>
16
+ <td id="total"></td>
17
+ <td id="code"></td><td id="code_per"></td>
18
+ <td id="comments"></td><td id="comments_per"></td>
19
+ <td id="blank"></td><td id="blank_per"></td>
20
+ </tr>
21
+ </table>
22
+ </div>
23
+ </body>
24
+ </html>
@@ -0,0 +1,14 @@
1
+ <h2><span id="loc_details"></span></h2>
2
+ <div id="loc_results">
3
+ <table width="100%" border="2">
4
+ <tr><th>Type</th><th>Total</th><th>Code</th><th>%</th><th>Comments</th><th>%</th><th>Blank</th><th>%</th><th>Files</th></tr>
5
+ <tr id="entry">
6
+ <td id="type"></td>
7
+ <td id="total"></td>
8
+ <td id="code"></td><td id="code_per"></td>
9
+ <td id="comments"></td><td id="comments_per"></td>
10
+ <td id="blank"></td><td id="blank_per"></td>
11
+ <td id="files"></td>
12
+ </tr>
13
+ </table>
14
+ </div>
@@ -0,0 +1,4 @@
1
+ <h2>Project related links</h2>
2
+ <ul id="outside_links">
3
+ <li id="item"></li>
4
+ </ul>
@@ -0,0 +1,23 @@
1
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
+ <html>
3
+ <head>
4
+ <title><span id="project_name"></span> Strange Requires <span id="build_date"></span></title>
5
+ <link rel="stylesheet" type="text/css" href="style.css"/>
6
+ </head>
7
+
8
+ <body>
9
+ <h1><span id="project_name"></span> Strange Requires <span id="build_date"></span></h1>
10
+
11
+ <div id="require_details">
12
+ <h2><span id="require_type"></span></h2>
13
+ <table width="100%" border="2">
14
+ <tr><th>From</th><th>To</th></tr>
15
+ <tr id="entry">
16
+ <td id="from"></td>
17
+ <td id="to"></td>
18
+ </tr>
19
+ </table>
20
+ </div>
21
+
22
+ </body>
23
+ </html>