Showing 80 of 167 total issues
Method github_action
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def github_action(client, &block)
if client.kind_of?(Octokit::Client)
# Inject Faraday::Request::Retry to the client if necessary
client = inject_retry_middleware(client)
# `rate_limit_retry_count` retains the variables through iterations so we assign to 0 the first time.
- 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 initialize
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(
git_config: nil,
local_folder: nil,
provider_credential: nil,
async_start: false,
Method setup_build_specific_environment_variables
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
def setup_build_specific_environment_variables
@environment_variables_set = []
# Set the CI specific Environment variables first
build_url = File.join(
Method run_pending_github_builds
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def self.run_pending_github_builds(projects: nil, github_service: nil)
logger.debug("Searching all projects for commits with pending status that need a new build")
# For each project, rerun all builds with the status of "pending"
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
- 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 store!
has a Cognitive Complexity of 14 (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 install_xcode!
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
def install_xcode!(version:, success_block: nil, error_block: nil)
raise "Please only pass `Gem::Version` to `install_xcode!`" unless version.kind_of?(Gem::Version)
apple_id_credentials_block do
unless installer.exist?(version)
Method github_action
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
def github_action(client, &block)
if client.kind_of?(Octokit::Client)
# Inject Faraday::Request::Retry to the client if necessary
client = inject_retry_middleware(client)
# `rate_limit_retry_count` retains the variables through iterations so we assign to 0 the first time.
Method set_build_status!
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def set_build_status!(repo: nil, sha: nil, state: nil, target_url: nil, description: nil, status_context:)
status_context = GitHubService.status_context_prefix + status_context
state = state.to_s
available_states = [
- 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 install_xcode!
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def install_xcode!(version:, success_block: nil, error_block: nil)
raise "Please only pass `Gem::Version` to `install_xcode!`" unless version.kind_of?(Gem::Version)
apple_id_credentials_block do
unless installer.exist?(version)
- 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 configuration_repository_valid?
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def configuration_repository_valid?
# Return cached true value, if it was successful, otherwise keep checking because it might have been fixed
return @config_repo_exists unless @config_repo_exists.nil? || (@config_repo_exists == false)
valid = configuration_repository_exists?
- 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 set_build_status!
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
def set_build_status!(repo: nil, sha: nil, state: nil, target_url: nil, description: nil, status_context:)
status_context = GitHubService.status_context_prefix + status_context
state = state.to_s
available_states = [
Method run_pending_github_builds
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.run_pending_github_builds(projects: nil, github_service: nil)
logger.debug("Searching all projects for commits with pending status that need a new build")
# For each project, rerun all builds with the status of "pending"
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
Method initialize
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize
@mutex = Mutex.new
@busy = false
# TODO: do we need a thread here to do the work or does `scheduler.schedule` handle that?
@thread = Thread.new do
Method jwt
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def jwt
authorization = request.env["HTTP_AUTHORIZATION"]
bearer_token = authorization && authorization.slice(7..-1) # strip off the `Bearer `
# give the option to pass the bearer token as a query param.
Method environment_variables_for_worker
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def environment_variables_for_worker
# Set the CI specific Environment variables first
# We try to follow the existing formats
# https://wiki.jenkins.io/display/JENKINS/Building+a+software+project
Method call
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def call(env)
unless Faye::WebSocket.websocket?(env)
# This is a regular HTTP call (no socket connection)
# so just redirect to the user's app
return @app.call(env)
Method execute_update
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def execute_update
tools_to_update = [GEM_NAME]
updater = Gem::CommandManager.instance[:update]
cleaner = Gem::CommandManager.instance[:cleanup]
Function exports
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular/cli'],
plugins: [
Method start_workers_for_project_and_credential
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def start_workers_for_project_and_credential(project: nil, provider_credential: nil, notification_service:)
user_responsible = provider_credential.ci_user
if user_responsible.nil?
name = project.project_name
- 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 ensure_logged_in
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def ensure_logged_in(route = nil)
if route.nil?
if defined?(self::HOME)
route = "#{self::HOME}*"
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"