Method call
has a Cognitive Complexity of 80 (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
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
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)
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 load_data
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def load_data(params, data_source)
first_name_column = params.first_name_column&.downcase || 'first_name'
last_name_column = params.last_name_column&.downcase || 'last_name'
login_column = params.login_column&.downcase || 'login'
password_column = params.password_column&.downcase || 'password'
- 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_data
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
def load_data(params, data_source)
first_name_column = params.first_name_column&.downcase || 'first_name'
last_name_column = params.last_name_column&.downcase || 'last_name'
login_column = params.login_column&.downcase || 'login'
password_column = params.password_column&.downcase || 'password'
Method read_csv_file
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def read_csv_file(path)
GoodData.logger.info('Start reading csv file')
res = []
row_count = 0
- 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"