Class Project
has 79 methods (exceeds 20 allowed). Consider refactoring. Open
class Project
attr_reader :name, :plugins, :build_command, :rake_task, :config_tracker, :path, :settings, :config_file_content, :error_message
attr_accessor :source_control, :scheduler, :use_bundler, :gemfile, :bundler_args
alias_method :id, :name
File project.rb
has 514 lines of code (exceeds 250 allowed). Consider refactoring. Open
class Project
attr_reader :name, :plugins, :build_command, :rake_task, :config_tracker, :path, :settings, :config_file_content, :error_message
attr_accessor :source_control, :scheduler, :use_bundler, :gemfile, :bundler_args
alias_method :id, :name
Method notify
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def notify(event, *event_parameters)
unless BuilderPlugin.known_event? event
raise "You attempted to notify the project of the #{event} event, but the plugin architecture does not understand this event. Add a method to BuilderPlugin, and document it."
end
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method build_if_necessary
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def build_if_necessary
begin
if build_necessary?(reasons = [])
remove_build_requested_flag_file if build_requested?
return build(source_control.latest_revision, reasons)
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method notify
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def notify(event, *event_parameters)
unless BuilderPlugin.known_event? event
raise "You attempted to notify the project of the #{event} event, but the plugin architecture does not understand this event. Add a method to BuilderPlugin, and document it."
end
Method build_without_serialization
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def build_without_serialization(revision, reasons)
return if revision.nil? # this will only happen in the case that there are no revisions yet
notify(:build_initiated)
previous_build = last_build
Method create
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def create(project_name, scm, dir=CruiseControl::Configuration.projects_root)
raise ArgumentError, "Project Name is required" if project_name.blank?
Project.new(:name => project_name, :scm => scm).tap do |project|
raise "Project named #{project.name.inspect} already exists in #{dir}" if Project.all(dir).include?(project)
begin
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method build_without_serialization
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def build_without_serialization(revision, reasons)
return if revision.nil? # this will only happen in the case that there are no revisions yet
notify(:build_initiated)
previous_build = last_build
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method load_config
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def load_config
begin
retried_after_update = false
begin
load_and_remember config_tracker.central_config_file
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method generate_release_note
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def generate_release_note(from_revision , to_revision , message , email, release_label)
Method request_build
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def request_build
if builder_state_and_activity == 'builder_down'
BuilderStarter.begin_builder(name)
10.times do
sleep 1.second.to_i
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method do_clean_checkout?
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def do_clean_checkout?
case @clean_checkout_when
when :always then true
when nil, :never then false
else
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"