Showing 6 of 20 total issues
File app_request_model_factory.rb
has 400 lines of code (exceeds 250 allowed). Consider refactoring. Confirmed
Confirmed
require 'fabricio/networking/request_model_factory'
require 'fabricio/networking/request_model'
require 'json'
module Fabricio
Method top_issues_request_model
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Confirmed
Confirmed
def top_issues_request_model(options = {})
options = {
:app_id => stored_app_id,
:start_time => week_ago_timestamp,
:end_time => today_timestamp,
Method crash_count_request_model
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Confirmed
Confirmed
def crash_count_request_model(options = {})
options = {
:app_id => stored_app_id,
:start_time => week_ago_timestamp,
:end_time => today_timestamp,
Method single_issue_request_model
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Confirmed
Confirmed
def single_issue_request_model(options = {})
options = {
:app_id => stored_app_id,
:issue_id => nil,
:start_time => week_ago_timestamp,
Method initialize
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Confirmed
Confirmed
def initialize(options = default_options)
options.each { |key, value| instance_variable_set("@#{key}", value) }
yield(self) if block_given?
@auth_client = Fabricio::Authorization::AuthorizationClient.new
- 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 obtain_session
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Confirmed
Confirmed
def obtain_session
return nil unless File.exist?(SESSION_FILE_PATH)
session_hash = YAML.load_file(SESSION_FILE_PATH)
return nil unless session_hash
session = Session.new(session_hash)
- 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"