Showing 80 of 167 total issues
Method handle_exception
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def handle_exception(ex, console_message: nil, exception_context: {})
unless console_message.nil?
logger.error(console_message)
end
logger.error(ex)
- 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 to_object_dictionary
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def to_object_dictionary(ignore_instance_variables: [])
object_hash = {}
instance_variables.each do |var|
next if ignore_instance_variables.include?(var)
# If we encounter with a `var` which value is an `Array`, we should iterate
- 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 from_json!
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def from_json!(json_object)
instance, json_object = _initialize_using!(json_object)
json_object.each do |var, val|
# If we encounter with a value that is represented by an array, iterate over it.
if val.kind_of?(Array)
- 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 register_available_controllers
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.register_available_controllers
# require all controllers
require_relative "app/features/all"
# Load up all the available controllers
Method enqueue_builds_for_open_github_prs_with_no_status
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.enqueue_builds_for_open_github_prs_with_no_status(projects: nil, github_service: nil)
logger.debug("Searching for open PRs with no status and starting a build for them")
projects.each do |project|
# Don't enqueue builds for the open pull requests if we don't have a pull request trigger defined for it
next if project.find_triggers_of_type(trigger_type: :pull_request).first.nil?
Method do_build
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def do_build
logger.debug("Running nightly build for #{project.project_name} (#{repo_full_name})")
# TODO: build_service could be injected instead of referenced like this
build_service = FastlaneCI::Services.build_service
Method remote_file_a_json_array?
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def remote_file_a_json_array?(file_path)
return false unless configuration_repository_exists?
logger.debug("Checking that #{repo_shortform}/#{file_path} is a json array")
contents_map = {}
- 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 commit_changes!
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def commit_changes!(commit_message: nil, push_after_commit: true, files_to_commit: [], repo_auth: self.repo_auth)
git_action_with_queue do
logger.debug("Starting commit_changes! #{git_config.git_url} for #{repo_auth.username}")
commit_message ||= "Automatic commit by fastlane.ci"
Method start
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def start
logger.debug("Starting build runner #{self.class} for #{project.project_name} #{project.id} sha: #{sha} now...")
start_time = Time.now
work_block = proc do
Method store!
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def store!(artifact:, build:, project:)
raise "Artifact to store was not provided or wrong type provided" unless artifact&.is_a?(Artifact)
raise "Build was not provided or wrong type provided" unless build&.is_a?(Build)
raise "Project was not provided or wrong type provided" unless project&.is_a?(Project)
- 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 fetch_available_lanes
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def fetch_available_lanes(fastfile_parser)
# we don't want to show `_before_all_block_`, `_after_all_block_` and `_error_block_`
# or a private lane as an available lane
lanes = []
fastfile_parser.tree.each do |platform, value|
- 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 fetch_available_lanes
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def fetch_available_lanes(fastfile_parser)
# we don't want to show `_before_all_block_`, `_after_all_block_` and `_error_block_`
# or a private lane as an available lane
lanes = []
fastfile_parser.tree.each do |platform, value|
- 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 _from_json!
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def _from_json!(var, val, is_iterable: false)
# TODO: attribute_key_name_map doesn't seem to be used anywhere in the code base
if attribute_key_name_map.key(var)
var_name = attribute_key_name_map.key(var).to_sym
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"
Further reading
Method start
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def start
save_build_status_locally!
env = environment_variables_for_worker
start_time = Time.now.utc
- 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 fastfile_from_contents_map
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def fastfile_from_contents_map(contents_map)
github_action(@client) do |_client|
return nil if contents_map.nil?
if contents_map
- 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
Avoid deeply nested control flow statements. Open
if repo.status.changed.count > 0 ||
repo.status.added.count > 0 ||
repo.status.deleted.count > 0 ||
repo.status.untracked.count > 0
begin
Method create_project!
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def create_project!(
name: nil,
repo_config: nil,
enabled: nil,
platform: nil,
- 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 delete_project!
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def delete_project!(project: nil)
unless project.nil?
raise "project must be configured with an instance of #{Project.name}" unless project.class <= Project
end
project_index = nil
- 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 start
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def start
logger.debug("Starting build runner #{self.class} for #{project.project_name} #{project.id} sha: #{sha} now...")
start_time = Time.now
work_block = proc do
- 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
Avoid deeply nested control flow statements. Open
rescue StandardError => ex
handle_exception(ex, console_message: "Error commiting changes to ci-config repo")