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,13 @@
1
+ <h2><span id="require_details"></span></h2>
2
+ <div id="require_results">
3
+ <table width="100%" border="2">
4
+ <tr>
5
+ <td>Requires to a file in a sub directory:</td>
6
+ <td id="sub_dir_requires"></td>
7
+ </tr>
8
+ <tr>
9
+ <td>Requires to a file in a parent (sub-)directory:</td>
10
+ <td id="parent_dir_requires"></td>
11
+ </tr>
12
+ </table>
13
+ </div>
@@ -0,0 +1,95 @@
1
+ body {
2
+ margin: 20px;
3
+ padding: 0;
4
+ font-size: 12px;
5
+ font-family: bitstream vera sans, verdana, arial, sans serif;
6
+ background-color: #efefef;
7
+ }
8
+
9
+ table {
10
+ border-collapse: collapse;
11
+ /*border-spacing: 0;*/
12
+ border: 1px solid #666;
13
+ background-color: #fff;
14
+ margin-bottom: 20px;
15
+ }
16
+
17
+ table, th, th+th, td, td+td {
18
+ border: 1px solid #ccc;
19
+ }
20
+
21
+ table th {
22
+ font-size: 12px;
23
+ color: #fc0;
24
+ padding: 4px;
25
+ background-color: #336;
26
+ }
27
+
28
+ th, td {
29
+ padding: 4px 10px;
30
+ }
31
+
32
+ td {
33
+ font-size: 13px;
34
+ }
35
+
36
+ .class_name {
37
+ font-size: 17px;
38
+ margin: 20px 0 0;
39
+ }
40
+
41
+ .class_complexity {
42
+ margin: 0 auto;
43
+ }
44
+
45
+ .class_complexity>.class_complexity {
46
+ margin: 0;
47
+ }
48
+
49
+ .class_total_complexity, .class_total_lines, .start_token_count, .file_count {
50
+ font-size: 13px;
51
+ font-weight: bold;
52
+ }
53
+
54
+ .class_total_complexity, .class_total_lines {
55
+ color: #c00;
56
+ }
57
+
58
+ .start_token_count, .file_count {
59
+ color: #333;
60
+ }
61
+
62
+ .warning {
63
+ background-color: yellow;
64
+ }
65
+
66
+ .error {
67
+ background-color: #f00;
68
+ }
69
+
70
+ .ok {
71
+ background-color: #00f000;
72
+ }
73
+
74
+ .mdd {
75
+ //float : right;
76
+ border: 1px solid;
77
+ width: 600px;
78
+ height: 700px;
79
+ }
80
+
81
+ .k1 {
82
+ background-image : url(mdd/1.png);
83
+ }
84
+
85
+ .k2 {
86
+ background-image : url(mdd/2.png);
87
+ }
88
+
89
+ .k3 {
90
+ background-image : url(mdd/3.png);
91
+ }
92
+
93
+ .k4 {
94
+ background-image : url(mdd/4.png);
95
+ }
@@ -0,0 +1,21 @@
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> Syntax Check Results <span id="build_date"></span></h1>
10
+ <div id="entry">
11
+ <table width="100%" border=2>
12
+ <tr><td><h3><a id="file_name_ref"></a></h3></td></tr>
13
+ <tr><td><h3>Errors</h3></td></tr>
14
+ <tr id="errors"><td id="error"></td></tr>
15
+ <tr><td><h3>Warnings</h3></td></tr>
16
+ <tr id="warnings"><td id="warning"></td></tr>
17
+ </table>
18
+ <hr>
19
+ </div>
20
+ </body>
21
+ </html>
@@ -0,0 +1,7 @@
1
+ <h2><span id="syntax_details"></span></h2>
2
+ <div id="syntax_results">
3
+ <table width="100%" border="2">
4
+ <tr><th>File</th><th># Errors</th><th># Warnings</th></tr>
5
+ <tr id="entry"><td><a id="file_name_link"></a></td><td id="error_count"></td><td id="warning_count"></td></tr>
6
+ </table>
7
+ </div>
@@ -0,0 +1,66 @@
1
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
+ <html>
3
+ <head>
4
+ <title><span id="project_name"></span> Unit Test Results <span
5
+ id="build_date"></span></title>
6
+ <link rel="stylesheet" type="text/css" href="style.css" />
7
+ <link rel="alternate" type="application/rss+xml" title="RSS" href="unit_test_results.rss" />
8
+ </head>
9
+
10
+ <body>
11
+ <h1><span id="project_name"></span> Unit Test Results <span
12
+ id="build_date"></span></h1>
13
+ <div id="entry">
14
+ <h3><a id="file_name_ref"></a></h3>
15
+ <div id="version">
16
+ <table border=1 width="100%">
17
+ <tr>
18
+ <th>Ruby Version</th>
19
+ <th># Failures</th>
20
+ <th># Errors</th>
21
+ <th># Tests</th>
22
+ <th># Assertions</th>
23
+ <th>Execution Time</th>
24
+ </tr>
25
+ <tr>
26
+ <td id='version_name'></td>
27
+ <td id="failures"></td>
28
+ <td id="errors"></td>
29
+ <td id="tests"></td>
30
+ <td id="assertions"></td>
31
+ <td id="time"></td>
32
+ </tr>
33
+ </table>
34
+ <table border=1 width="100%">
35
+ <tr>
36
+ <td>
37
+ <h4>Result Info</h4>
38
+ </td>
39
+ </tr>
40
+ <tr id="test_results">
41
+ <td><pre id="test_info"></pre></td>
42
+ </tr>
43
+ </table>
44
+ </div>
45
+ <table width="100%" border="2">
46
+ <tr>
47
+ <td>
48
+ <h4>System Errors</h4>
49
+ </td>
50
+ </tr>
51
+ <tr id="sys_errors">
52
+ <td id="error"></td>
53
+ </tr>
54
+ <tr>
55
+ <td>
56
+ <h4>System Warnings</h4>
57
+ </td>
58
+ </tr>
59
+ <tr id="warnings">
60
+ <td id="warning"></td>
61
+ </tr>
62
+ </table>
63
+ <hr>
64
+ </div>
65
+ </body>
66
+ </html>
@@ -0,0 +1,70 @@
1
+ <h2>Unit Tests</h2>
2
+
3
+ <div id="process_run_time">
4
+ <table border="2">
5
+ <tr>
6
+ <th>Task time</th>
7
+ </tr>
8
+ <tr>
9
+ <td id='task_time'></td>
10
+ </tr>
11
+ </table>
12
+ </div>
13
+
14
+ <div id="unit_test_timing">
15
+ <table border="2">
16
+ <tr>
17
+ <th>Ruby Version</th>
18
+ <th>Test Total Time</th>
19
+ <th><span id="error_threshold"></span> sec</th>
20
+ <th><span id="warning_threshold"></span> sec</th>
21
+ </tr>
22
+ <tr id="timing_stats">
23
+ <td id='version_name'></td>
24
+ <td id='total_time'></td>
25
+ <td id='errors'></td>
26
+ <td id='warnings'></td>
27
+ </tr>
28
+ </table>
29
+ </div>
30
+
31
+ <div id="unit_test_results">
32
+ <h3 id="unit_tests_link">Unit Test Details</h3>
33
+ <table width="100%" border="2">
34
+ <tr>
35
+ <th>Unit Test File</th>
36
+ <th>Execution Time</th>
37
+ <th># Tests</th>
38
+ <th># Assertions</th>
39
+ <th># Failures</th>
40
+ <th># Errors</th>
41
+ <th>Ruby Version</th>
42
+ </tr>
43
+ <tr id="entry">
44
+ <td><a id="file_name_link"></a></td>
45
+ <td id="time"></td>
46
+ <td id="tests"></td>
47
+ <td id="assertions"></td>
48
+ <td id="failures"></td>
49
+ <td id="errors"></td>
50
+ <td id='version_name'></td>
51
+ </tr>
52
+ </table>
53
+ </div>
54
+
55
+ <div id="unit_test_timing">
56
+ <h3>Slowest Test Cases</h3>
57
+ <table border="2">
58
+ <tr>
59
+ <th>Unit Test File</th>
60
+ <th>Ruby Version</th>
61
+ <th>Execution Time</th>
62
+ </tr>
63
+ <tr id="time_violations">
64
+ <td><a id="file_name_link"></a></td>
65
+ <td id='version_name'></td>
66
+ <td id="time"></td>
67
+ </tr>
68
+ </table>
69
+
70
+ </div>
@@ -0,0 +1,32 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # Created by Zev on 2007-06-22.
4
+ # Copyright (c) 2007. All rights reserved.
5
+
6
+ require 'test/unit'
7
+ require 'kwala'
8
+
9
+ class TestBuildAction < BuildAction
10
+
11
+ def self.command_line_action_name
12
+ "test_action"
13
+ end
14
+
15
+ end
16
+
17
+ class TC_Build_Action < Test::Unit::TestCase
18
+
19
+ def setup
20
+ @action = TestBuildAction.new
21
+ end
22
+
23
+ def test_create_action_from_command_line_name
24
+ action = BuildAction.create_action_from_command_line_name(TestBuildAction.command_line_action_name)
25
+ assert_kind_of TestBuildAction, action
26
+ end
27
+
28
+ def test_command_line_action_names
29
+ assert_equal ["test_action"], BuildAction.command_line_action_names
30
+ end
31
+
32
+ end
@@ -0,0 +1,24 @@
1
+ require 'test/unit'
2
+ require 'kwala'
3
+
4
+ class TC_Build_Action < Test::Unit::TestCase
5
+
6
+ ProjectBuilderUtils.load_actions
7
+
8
+ def test_build_templates
9
+ BuildAction.get_implementors.each do |action|
10
+
11
+ if action.summary_template_file
12
+ assert( File.exist?(action.summary_template_file),
13
+ "Could not find summary file #{action.summary_template_file} for action #{action.class.name}" )
14
+ end
15
+
16
+ if action.detailed_template_file
17
+
18
+ assert( File.exist?(action.detailed_template_file),
19
+ "Could not find detailed file #{action.detailed_template_file} for action #{action.class.name}" )
20
+ end
21
+ end
22
+ end
23
+
24
+ end
metadata ADDED
@@ -0,0 +1,118 @@
1
+ --- !ruby/object:Gem::Specification
2
+ rubygems_version: 0.9.4
3
+ specification_version: 1
4
+ name: kwala
5
+ version: !ruby/object:Gem::Version
6
+ version: 0.9.0
7
+ date: 2008-06-21 00:00:00 +09:00
8
+ summary: Kwala is a pluggable code quality build system with the ability to due CI + Mascot Driven Development Motivation
9
+ require_paths:
10
+ - lib
11
+ email: zblut@cerego.co.jp
12
+ homepage: http://kwala.rubyforge.org/
13
+ rubyforge_project: kwala
14
+ description:
15
+ autorequire:
16
+ default_executable:
17
+ bindir: bin
18
+ has_rdoc: true
19
+ required_ruby_version: !ruby/object:Gem::Version::Requirement
20
+ requirements:
21
+ - - ">"
22
+ - !ruby/object:Gem::Version
23
+ version: 0.0.0
24
+ version:
25
+ platform: ruby
26
+ signing_key:
27
+ cert_chain:
28
+ post_install_message:
29
+ authors:
30
+ - Zev Blut
31
+ files:
32
+ - bin/kwala
33
+ - lib/kwala
34
+ - lib/kwala/actions
35
+ - lib/kwala/actions/code_change.rb
36
+ - lib/kwala/actions/code_coverage.rb
37
+ - lib/kwala/actions/code_duplication.rb
38
+ - lib/kwala/actions/code_formatting.rb
39
+ - lib/kwala/actions/cycle_detection.rb
40
+ - lib/kwala/actions/cyclomatic_complexity.rb
41
+ - lib/kwala/actions/dead_code.rb
42
+ - lib/kwala/actions/executable_files_check.rb
43
+ - lib/kwala/actions/flagged_comments.rb
44
+ - lib/kwala/actions/gem_plugin.rb
45
+ - lib/kwala/actions/loc_count.rb
46
+ - lib/kwala/actions/multi_ruby_unit_test.rb
47
+ - lib/kwala/actions/outside_links.rb
48
+ - lib/kwala/actions/rails_migrate.rb
49
+ - lib/kwala/actions/strange_requires.rb
50
+ - lib/kwala/actions/syntax_check.rb
51
+ - lib/kwala/actions/unit_test.rb
52
+ - lib/kwala/build_action.rb
53
+ - lib/kwala/build_context.rb
54
+ - lib/kwala/command_line_runner.rb
55
+ - lib/kwala/ext
56
+ - lib/kwala/ext/demos.jar
57
+ - lib/kwala/ext/pmd.jar
58
+ - lib/kwala/ext/prefuse.jar
59
+ - lib/kwala/extensions.rb
60
+ - lib/kwala/lib
61
+ - lib/kwala/lib/code_analyzer.rb
62
+ - lib/kwala/lib/cycle_detector.rb
63
+ - lib/kwala/lib/strange_requires_detector.rb
64
+ - lib/kwala/notification.rb
65
+ - lib/kwala/notifications
66
+ - lib/kwala/notifications/email.rb
67
+ - lib/kwala/notifications/rss.rb
68
+ - lib/kwala/project_builder_utils.rb
69
+ - lib/kwala/templates
70
+ - lib/kwala/templates/build_template.html
71
+ - lib/kwala/templates/code_change_summary.html
72
+ - lib/kwala/templates/code_coverage_detailed.html
73
+ - lib/kwala/templates/code_coverage_summary.html
74
+ - lib/kwala/templates/code_duplication_detailed.html
75
+ - lib/kwala/templates/code_duplication_summary.html
76
+ - lib/kwala/templates/code_formatting_detailed.html
77
+ - lib/kwala/templates/code_formatting_summary.html
78
+ - lib/kwala/templates/cycle_detection_detailed.html
79
+ - lib/kwala/templates/cycle_detection_summary.html
80
+ - lib/kwala/templates/cyclomatic_complexity_summary.html
81
+ - lib/kwala/templates/executable_files_check_detailed.html
82
+ - lib/kwala/templates/executable_files_check_summary.html
83
+ - lib/kwala/templates/flagged_comments_detailed.html
84
+ - lib/kwala/templates/flagged_comments_summary.html
85
+ - lib/kwala/templates/loc_count_detailed.html
86
+ - lib/kwala/templates/loc_count_summary.html
87
+ - lib/kwala/templates/mdd
88
+ - lib/kwala/templates/mdd/1.png
89
+ - lib/kwala/templates/mdd/2.png
90
+ - lib/kwala/templates/mdd/3.png
91
+ - lib/kwala/templates/mdd/4.png
92
+ - lib/kwala/templates/mdd/5.png
93
+ - lib/kwala/templates/outside_links_summary.html
94
+ - lib/kwala/templates/strange_requires_detailed.html
95
+ - lib/kwala/templates/strange_requires_summary.html
96
+ - lib/kwala/templates/style.css
97
+ - lib/kwala/templates/syntax_check_detailed.html
98
+ - lib/kwala/templates/syntax_check_summary.html
99
+ - lib/kwala/templates/unit_test_detailed.html
100
+ - lib/kwala/templates/unit_test_summary.html
101
+ - lib/kwala.rb
102
+ - test/tc_build_action.rb
103
+ - test/tc_templates.rb
104
+ - README
105
+ test_files: []
106
+
107
+ rdoc_options: []
108
+
109
+ extra_rdoc_files:
110
+ - README
111
+ executables:
112
+ - kwala
113
+ extensions: []
114
+
115
+ requirements: []
116
+
117
+ dependencies: []
118
+