strongself/fabricio

View on GitHub

Showing 8 of 20 total issues

Class has too many lines. [392/250]
Confirmed

    class AppRequestModelFactory < RequestModelFactory

      # Returns a request model for obtaining the list of all apps
      #
      # @return [Fabricio::Networking::RequestModel]

This cop checks if the length a class exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

File app_request_model_factory.rb has 400 lines of code (exceeds 250 allowed). Consider refactoring.
Confirmed

require 'fabricio/networking/request_model_factory'
require 'fabricio/networking/request_model'
require 'json'

module Fabricio
Severity: Minor
Found in lib/fabricio/networking/app_request_model_factory.rb - About 5 hrs to fix

    Method has too many lines. [33/30]
    Confirmed

          def top_issues_request_model(options = {})
            options = {
              :app_id => stored_app_id,
              :start_time => week_ago_timestamp,
              :end_time => today_timestamp,

    This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

    Method top_issues_request_model has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Confirmed

          def top_issues_request_model(options = {})
            options = {
              :app_id => stored_app_id,
              :start_time => week_ago_timestamp,
              :end_time => today_timestamp,
    Severity: Minor
    Found in lib/fabricio/networking/app_request_model_factory.rb - About 1 hr to fix

      Method crash_count_request_model has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Confirmed

            def crash_count_request_model(options = {})
              options = {
                :app_id => stored_app_id,
                :start_time => week_ago_timestamp,
                :end_time => today_timestamp,
      Severity: Minor
      Found in lib/fabricio/networking/app_request_model_factory.rb - About 1 hr to fix

        Method single_issue_request_model has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Confirmed

              def single_issue_request_model(options = {})
                options = {
                    :app_id => stored_app_id,
                    :issue_id => nil,
                    :start_time => week_ago_timestamp,
        Severity: Minor
        Found in lib/fabricio/networking/app_request_model_factory.rb - About 1 hr to fix

          Method initialize has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          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
          Severity: Minor
          Found in lib/fabricio/client/client.rb - About 45 mins to fix

          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

                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)
          Severity: Minor
          Found in lib/fabricio/authorization/file_session_storage.rb - About 45 mins to fix

          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

          Severity
          Category
          Status
          Source
          Language