Home
DevCentral
Search
Configure Global Search
Log In
Transactions
P204
Change Details
Change Details
Old
New
Diff
Inspecting 1 file C Offenses: tommy.rb:10:1: C: Missing top-level class documentation comment. class Project < Hashie::Dash ^^^^^ tommy.rb:20:1: C: Trailing whitespace detected. tommy.rb:21:3: C: Assignment Branch Condition size for parse_incoming_json is too high. [35.41/15] def self.parse_incoming_json(json) ^^^ tommy.rb:21:3: C: Method has too many lines. [15/10] def self.parse_incoming_json(json) ... ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ tommy.rb:24:1: C: Trailing whitespace detected. tommy.rb:26:7: C: Favor unless over if for negative conditions. next if !project['buildable'] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ tommy.rb:28:40: C: Space inside parentheses detected. returned_projects << Project.new( :name => project['displayName'].gsub('-', ' '), ^ tommy.rb:28:41: C: Use the new Ruby 1.9 hash syntax. returned_projects << Project.new( :name => project['displayName'].gsub('-', ' '), ^^^^^^^^ tommy.rb:28:73: C: Use tr instead of gsub. returned_projects << Project.new( :name => project['displayName'].gsub('-', ' '), ^^^^^^^^^^^^^^ tommy.rb:28:81: C: Line is too long. [87/80] returned_projects << Project.new( :name => project['displayName'].gsub('-', ' '), ^^^^^^^ tommy.rb:29:41: C: Use the new Ruby 1.9 hash syntax. :build_score => project['healthReport'].first['score'].to_i, ^^^^^^^^^^^^^^^ tommy.rb:29:81: C: Line is too long. [100/80] :build_score => project['healthReport'].first['score'].to_i, ^^^^^^^^^^^^^^^^^^^^ tommy.rb:30:41: C: Use the new Ruby 1.9 hash syntax. :last_build_number => project['builds'].first['number'], ^^^^^^^^^^^^^^^^^^^^^ tommy.rb:30:81: C: Line is too long. [96/80] :last_build_number => project['builds'].first['number'], ^^^^^^^^^^^^^^^^ tommy.rb:31:41: C: Use the new Ruby 1.9 hash syntax. :last_build_url => (project['lastBuild'].blank? ? "" : project['lastBuild']['url']), ^^^^^^^^^^^^^^^^^^ tommy.rb:31:81: C: Line is too long. [124/80] :last_build_url => (project['lastBuild'].blank? ? "" : project['lastBuild']['url']), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ tommy.rb:31:91: C: Prefer single-quoted strings when you don't need string interpolation or special symbols. :last_build_url => (project['lastBuild'].blank? ? "" : project['lastBuild']['url']), ^^ tommy.rb:32:41: C: Use the new Ruby 1.9 hash syntax. :last_stable_build => (project['lastStableBuild'].blank? ? "" : project['lastStableBuild']['number']), ^^^^^^^^^^^^^^^^^^^^^ tommy.rb:32:81: C: Line is too long. [142/80] :last_stable_build => (project['lastStableBuild'].blank? ? "" : project['lastStableBuild']['number']), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ tommy.rb:32:100: C: Prefer single-quoted strings when you don't need string interpolation or special symbols. :last_stable_build => (project['lastStableBuild'].blank? ? "" : project['lastStableBuild']['number']), ^^ tommy.rb:33:41: C: Use the new Ruby 1.9 hash syntax. :health_report => project['healthReport'].first['description'], ^^^^^^^^^^^^^^^^^ tommy.rb:33:81: C: Line is too long. [103/80] :health_report => project['healthReport'].first['description'], ^^^^^^^^^^^^^^^^^^^^^^^ tommy.rb:34:41: C: Use the new Ruby 1.9 hash syntax. :last_complete_url => (project['lastCompletedBuild'].blank? ? "" : project['lastCompletedBuild']['url']), ^^^^^^^^^^^^^^^^^^^^^ tommy.rb:34:81: C: Line is too long. [145/80] :last_complete_url => (project['lastCompletedBuild'].blank? ? "" : project['lastCompletedBuild']['url']), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ tommy.rb:34:103: C: Prefer single-quoted strings when you don't need string interpolation or special symbols. :last_complete_url => (project['lastCompletedBuild'].blank? ? "" : project['lastCompletedBuild']['url']), ^^ tommy.rb:35:41: C: Use the new Ruby 1.9 hash syntax. :last_failed_url => (project['lastFailedBuild'].blank? ? "" : project['lastFailedBuild']['url'] ), ^^^^^^^^^^^^^^^^^^^ tommy.rb:35:81: C: Line is too long. [138/80] :last_failed_url => (project['lastFailedBuild'].blank? ? "" : project['lastFailedBuild']['url'] ), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ tommy.rb:35:98: C: Prefer single-quoted strings when you don't need string interpolation or special symbols. :last_failed_url => (project['lastFailedBuild'].blank? ? "" : project['lastFailedBuild']['url'] ), ^^ tommy.rb:35:136: C: Space inside parentheses detected. :last_failed_url => (project['lastFailedBuild'].blank? ? "" : project['lastFailedBuild']['url'] ), ^ tommy.rb:36:41: C: Use the new Ruby 1.9 hash syntax. :colour => project['color']) ^^^^^^^^^^ tommy.rb:38:1: C: Trailing whitespace detected. tommy.rb:39:5: C: Redundant return detected. return returned_projects ^^^^^^ tommy.rb:41:1: C: Trailing whitespace detected. tommy.rb:42:7: C: Rename is_green? to green?. def is_green? ^^^^^^^^^ tommy.rb:43:5: C: Redundant self detected. self.last_stable_build == self.last_build_number ^^^^^^^^^^^^^^^^^^^^^^ tommy.rb:43:31: C: Redundant self detected. self.last_stable_build == self.last_build_number ^^^^^^^^^^^^^^^^^^^^^^ tommy.rb:46:7: C: Rename is_building? to building?. def is_building? ^^^^^^^^^^^^ tommy.rb:47:5: C: Redundant self detected. self.colour.include?('anime') ^^^^^^^^^^^ tommy.rb:54:1: C: Trailing whitespace detected. tommy.rb:59:3: C: Cyclomatic complexity for css_for_project is too high. [7/6] def css_for_project(project) ^^^ tommy.rb:59:3: C: Method has too many lines. [18/10] def css_for_project(project) ... ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ tommy.rb:59:3: C: Perceived complexity for css_for_project is too high. [9/7] def css_for_project(project) ^^^ tommy.rb:63:9: C: Prefer single-quoted strings when you don't need string interpolation or special symbols. "best" ^^^^^^ tommy.rb:65:9: C: Prefer single-quoted strings when you don't need string interpolation or special symbols. "better" ^^^^^^^^ tommy.rb:67:9: C: Prefer single-quoted strings when you don't need string interpolation or special symbols. "good" ^^^^^^ tommy.rb:69:9: C: Prefer single-quoted strings when you don't need string interpolation or special symbols. "bad" ^^^^^ tommy.rb:71:9: C: Prefer single-quoted strings when you don't need string interpolation or special symbols. "worse" ^^^^^^^ tommy.rb:74:7: C: Prefer single-quoted strings when you don't need string interpolation or special symbols. "building" ^^^^^^^^^^ tommy.rb:76:7: C: Prefer single-quoted strings when you don't need string interpolation or special symbols. "worst" ^^^^^^^ 1 file inspected, 49 offenses detected
Inspecting 1 file C Offenses: tommy.rb:1:1: C: Style/FrozenStringLiteralComment: Missing magic comment # frozen_string_literal: true. # ------------------------------------------------------------- ^ tommy.rb:55:3: C: Metrics/AbcSize: Assignment Branch Condition size for parse_project is too high. [25.81/15] def self.parse_project(data) ... ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ tommy.rb:55:3: C: Metrics/MethodLength: Method has too many lines. [24/10] def self.parse_project(data) ... ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ tommy.rb:77:7: C: Layout/EmptyLineAfterGuardClause: Add empty line after guard clause. next if data[api_property].blank? ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 1 file inspected, 4 offenses detected
Inspecting 1 file C Offenses: tommy.rb:1
0
:1: C:
Missing top-level class docu
Style/FrozenStringLiteralComment: Missing magic com
ment
ation comment
# frozen_string_literal: true
.
class Project < Hashie::Dash
# -------------------------------------------------------------
^^^^^ tommy.rb:20:1: C: Trailing whitespace detected. tommy.rb:21:3: C: Assignment Branch Condition size for parse_incoming_json is too high. [35.41/15] def self.parse_incoming_json(json) ^^^ tommy.rb:21:3: C: Method has too many lines. [15/10] def self.parse_incoming_json(json) ... ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ tommy.rb:24:1: C: Trailing whitespace detected. tommy.rb:26:7: C: Favor unless over if for negative conditions. next if !project['buildable'] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ tommy.rb:28:40: C: Space inside parentheses detected. returned_projects << Project.new( :name => project['displayName'].gsub('-', ' '),
^ tommy.
rb:28:41: C: Use the new Ruby 1.9 hash syntax. returned_projects << Project.new( :name => project['displayName'].gsub('-', ' '), ^^^^^^^^ tommy.rb:28:73: C: Use tr instead of gsub. returned_projects << Project.new( :name => project['displayName'].gsub('-', ' '), ^^^^^^^^^^^^^^ tommy.rb:28:81: C: Line is too long. [87/80] returned_projects << Project.new( :name => project['displayName'].gsub('-', ' '), ^^^^^^^ tommy.rb:29:41: C: Use the new Ruby 1.9 hash syntax. :build_score => project['healthReport'].first['score'].to_i, ^^^^^^^^^^^^^^^ tommy.rb:29:81: C: Line is too long. [100/80] :build_score => project['healthReport'].first['score'].to_i, ^^^^^^^^^^^^^^^^^^^^ tommy.rb:30:41: C: Use the new Ruby 1.9 hash syntax. :last_build_number => project['builds'].first['number'], ^^^^^^^^^^^^^^^^^^^^^ tommy.rb:30:81: C: Line is too long. [96/80] :last_build_number => project['builds'].first['number'], ^^^^^^^^^^^^^^^^ tommy.rb:31:41: C: Use the new Ruby 1.9 hash syntax. :last_build_url => (project['lastBuild'].blank? ? "" : project['lastBuild']['url']), ^^^^^^^^^^^^^^^^^^ tommy.rb:31:81: C: Line is too long. [124/80] :last_build_url => (project['lastBuild'].blank? ? "" : project['lastBuild']['url']), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ tommy.rb:31:91: C: Prefer single-quoted strings when you don't need string interpolation or special symbols. :last_build_url => (project['lastBuild'].blank? ? "" : project['lastBuild']['url']), ^^ tommy.rb:32:41: C: Use the new Ruby 1.9 hash syntax. :last_stable_build => (project['lastStableBuild'].blank? ? "" : project['lastStableBuild']['number']), ^^^^^^^^^^^^^^^^^^^^^ tommy.rb:32:81: C: Line is too long. [142/80] :last_stable_build => (project['lastStableBuild'].blank? ? "" : project['lastStableBuild']['number']), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ tommy.rb:32:100: C: Prefer single-quoted strings when you don't need string interpolation or special symbols. :last_stable_build => (project['lastStableBuild'].blank? ? "" : project['lastStableBuild']['number']), ^^ tommy.rb:33:41: C: Use the new Ruby 1.9 hash syntax. :health_report => project['healthReport'].first['description'], ^^^^^^^^^^^^^^^^^ tommy.rb:33:81: C: Line is too long. [103/80] :health_report => project['healthReport'].first['description'], ^^^^^^^^^^^^^^^^^^^^^^^ tommy.rb:34:41: C: Use the new Ruby 1.9 hash syntax. :last_complete_url => (project['lastCompletedBuild'].blank? ? "" : project['lastCompletedBuild']['url']), ^^^^^^^^^^^^^^^^^^^^^ tommy.rb:34:81: C: Line is too long. [145/80] :last_complete_url => (project['lastCompletedBuild'].blank? ? "" : project['lastCompletedBuild']['url']), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ tommy.rb:34:103: C: Prefer single-quoted strings when you don't need string interpolation or special symbols. :last_complete_url => (project['lastCompletedBuild'].blank? ? "" : project['lastCompletedBuild']['url']), ^^ tommy.rb:35:41: C: Use the new Ruby 1.9 hash syntax. :last_failed_url => (project['lastFailedBuild'].blank? ? "" : project['lastFailedBuild']['url'] ), ^^^^^^^^^^^^^^^^^^^ tommy.rb:35:81: C: Line is too long. [138/80] :last_failed_url => (project['lastFailedBuild'].blank? ? "" : project['lastFailedBuild']['url'] ), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ tommy.rb:35:98: C: Prefer single-quoted strings when you don't need string interpolation or special symbols. :last_failed_url => (project['lastFailedBuild'].blank? ? "" : project['lastFailedBuild']['url'] ), ^^ tommy.rb:35:136: C: Space inside parentheses detected. :last_failed_url => (project['lastFailedBuild'].blank? ? "" : project['lastFailedBuild']['url'] ), ^ tommy.rb:36:41: C: Use the new Ruby 1.9 hash syntax. :colour => project['color']) ^^^^^^^^^^ tommy.rb:38:1: C: Trailing whitespace detected. tommy.rb:39:5: C: Redundant return detected. return returned_projects ^^^^^^ tommy.rb:41:1: C: Trailing whitespace detected. tommy.rb:42:7: C: Rename is_green? to green?. def is_green? ^^^^^^^^^ tommy.rb:43:5: C: Redundant self detected. self.last_stable_build == self.last_build_number ^^^^^^^^^^^^^^^^^^^^^^ tommy.rb:43:31: C: Redundant self detected. self.last_stable_build == self.last_build_number ^^^^^^^^^^^^^^^^^^^^^^ tommy.rb:46:7: C: Rename is_building? to building?. def is_building? ^^^^^^^^^^^^ tommy.rb:47:5: C: Redundant self detected. self.colour.include?('anime') ^^^^^^^^^^^ tommy.rb:54:1: C: Trailing whitespace detected. tommy.rb:59:3: C: Cyclomatic complexity for css_for_project is too high. [7/6
rb:55:3: C: Metrics/AbcSize: Assignment Branch Condition size for parse_project is too high. [25.81/15
] def
css_for_project(project) ^^^ tommy.rb:59:3: C: Method has too many lines. [18/10] def css_for
self.parse
_project(
project
data
) ... ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ tommy.rb:5
9
5
:3: C:
Perceived complexity for css_for_project is too high
Metrics/MethodLength: Method has too many lines
. [
9/7
24/10
] def
css_for
self.parse
_project(
project)
data) ...
^^^
tommy.rb:63:9: C: Prefer single-quoted strings when you don't need string interpolation or special symbols. "best" ^^^^^^ tommy.rb:65:9: C: Prefer single-quoted strings when you don't need string interpolation or special symbols. "better" ^^^^^^^^ tommy.rb:67:9: C: Prefer single-quoted strings when you don't need string interpolation or special symbols. "good" ^^^^^^ tommy.rb:69:9: C: Prefer single-quoted strings when you don't need string interpolation or special symbols. "bad" ^^^^^ tommy.rb:71:9: C: Prefer single-quoted strings when you don't need string interpolation or special symbols. "worse" ^^^^^^^ tommy.rb:74:7: C: Prefer single-quoted strings when you don't need string interpolation or special symbols. "building"
^^^^^^^^^^^^^^^
^^^^^^^^^^ tommy.rb:7
6
7
:7: C:
Prefer single-quoted strings when you don't need string interpolation or special symbols
Layout/EmptyLineAfterGuardClause: Add empty line after guard clause
.
"worst"
next if data[api_property].blank?
^^^^^^^
^^^^^^^^^^^^^^^^^^^^^^^^^^
1 file inspected, 4
9
offenses detected
Continue