Showing 359 of 407 total issues
Method call
has 162 lines of code (exceeds 25 allowed). Consider refactoring. Open
def call(params)
client = params.gdc_gd_client
domain_name = params.organization || params.domain
fail "Either organisation or domain has to be specified in params" unless domain_name
project = client.projects(params.gdc_project) || client.projects(params.gdc_project_id)
Method perform
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
def perform(mode, params = {})
params = convert_params(params)
GoodData.gd_logger.brick = mode
- 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 transfer_schedules
has 151 lines of code (exceeds 25 allowed). Consider refactoring. Open
def transfer_schedules(from_project, to_project, has_cycle_trigger = false)
to_project_processes = to_project.processes.sort_by(&:name)
from_project_processes = from_project.processes.sort_by(&:name)
from_project_processes.reject!(&:add_v2_component?)
Method replace_from_mapping
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
def replace_from_mapping(mapping, opts = {})
default = {
:purge => false,
:dry_run => false
}
- 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
File lcm2.rb
has 399 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'terminal-table'
require 'gooddata/extensions/class'
require 'gooddata/extensions/true'
require 'gooddata/extensions/false'
Method call
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
def call(params)
logger = params.gdc_logger
client = params.gdc_gd_client
project = client.projects(params.gdc_project) || client.projects(params.gdc_project_id)
- 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
Class Client
has 38 methods (exceeds 20 allowed). Consider refactoring. Open
class Client
#################################
# Constants
#################################
DEFAULT_CONNECTION_IMPLEMENTATION = GoodData::Rest::Connection
Class Connection
has 38 methods (exceeds 20 allowed). Consider refactoring. Open
class Connection
include MonitorMixin
HTTPS_PROTOCOL = 'https://'
HTTP_PROTOCOL = 'http://'
Class Process
has 36 methods (exceeds 20 allowed). Consider refactoring. Open
class Process < Rest::Resource
attr_reader :data
alias_method :raw_data, :data
alias_method :json, :data
File schedule.rb
has 351 lines of code (exceeds 250 allowed). Consider refactoring. Open
require_relative '../rest/resource'
require_relative '../mixins/rest_resource'
require_relative '../helpers/global_helpers'
require_relative 'execution'
File synchronize_users.rb
has 345 lines of code (exceeds 250 allowed). Consider refactoring. Open
require_relative 'base_action'
require_relative '../user_bricks_helper'
module GoodData
module LCM2
Method add_user
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def add_user(user_data, name = nil, opts = { :client => GoodData.connection })
generated_pass = GoodData::Helpers::CryptoHelper.generate_password
domain_name = name || user_data[:domain]
user_data = user_data.to_hash
data = {
- 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 call
has 106 lines of code (exceeds 25 allowed). Consider refactoring. Open
def call(params)
client = params.gdc_gd_client
domain_name = params.organization || params.domain
fail "Either organisation or domain has to be specified in params" unless domain_name
Method call
has 106 lines of code (exceeds 25 allowed). Consider refactoring. Open
def call(params)
client = params.gdc_gd_client
data_product = params.data_product
collect_synced_status = collect_synced_status(params)
failed_projects = ThreadSafe::Array.new
Method import_users
has 103 lines of code (exceeds 25 allowed). Consider refactoring. Open
def import_users(new_users, options = {})
role_list = roles
users_list = users
GoodData.logger.warn("Importing users to project (#{pid})")
Method update_user
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def update_user(user_data, options = { client: GoodData.connection })
user_data = user_data.to_hash if user_data.is_a?(GoodData::Profile)
client = client(options)
user_data = user_data.to_hash
data = {
- 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 call
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def call(params)
client = params.gdc_gd_client
domain_name = params.organization || params.domain
fail "Either organisation or domain has to be specified in params" unless domain_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 sync_segment_ldm
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
def sync_segment_ldm(params, segment_info)
collect_synced_status = collect_synced_status(params)
failed_projects = ThreadSafe::Array.new
results = ThreadSafe::Array.new
client = params.gdc_gd_client
Class ReportDataResult
has 31 methods (exceeds 20 allowed). Consider refactoring. Open
class ReportDataResult < Rest::Resource
class << self
# Does all the needed parsing on the apyload coming from the API and returns an instance of ReportDataResult
#
# @param [Hash] data Data coming from the API
Method execute_mufs
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.execute_mufs(user_filters, options = {})
client = options[:client]
project = options[:project]
ignore_missing_values = options[:ignore_missing_values]
users_must_exist = options[:users_must_exist] == false ? false : true