File data_gateway.rb
has 367 lines of code (exceeds 250 allowed). Consider refactoring. Open
class ArtirixDataModels::DataGateway
attr_reader :connection, :post_as_json
def initialize(connection: nil,
post_as_json: true,
Method connect
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
def connect(method,
path:,
body: nil,
json_body: true,
timeout: 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
Class DataGateway
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class ArtirixDataModels::DataGateway
attr_reader :connection, :post_as_json
def initialize(connection: nil,
post_as_json: true,
Method connection
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def connection(config: {},
url: nil,
login: nil,
password: nil,
bearer_token: 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 call
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def call(method,
path,
authorization_bearer: nil,
authorization_token_hash: nil,
body: 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 call
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def call(method,
path,
authorization_bearer: nil,
authorization_token_hash: nil,
body: nil,
Method connect
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def connect(method,
path:,
body: nil,
json_body: true,
timeout: nil,
Method parse_response
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def parse_response(result:, response_adaptor:, path:, method:, json_parse_response: true)
if result.blank?
parsed_response = nil
elsif json_parse_response
parsed_response = Oj.load result, symbol_keys: true
- 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 a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def initialize(*args)
case args.size
when 0
message = nil
options = {}
- 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"