seomoz/interpol

View on GitHub

Showing 8 of 23 total issues

Class Configuration has 37 methods (exceeds 20 allowed). Consider refactoring.
Open

  class Configuration
    attr_reader :endpoint_definition_files, :endpoints, :filter_example_data_blocks,
                :endpoint_definition_merge_key_files
    attr_accessor :validation_mode, :documentation_title

Severity: Minor
Found in lib/interpol/configuration.rb - About 4 hrs to fix

    File endpoint.rb has 304 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    require 'forwardable'
    require 'interpol/errors'
    require 'json'
    require 'json-schema'
    require 'set'
    Severity: Minor
    Found in lib/interpol/endpoint.rb - About 3 hrs to fix

      Function show has 43 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        , show: function () {
            var $tip
              , inside
              , pos
              , actualWidth

        Function slide has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          , slide: function (type, next) {
              var $active = this.$element.find('.active')
                , $next = next || $active[type]()
                , isCycling = this.interval
                , direction = type == 'next' ? 'left' : 'right'

          Method initialize has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                def initialize(status, headers, body, env, config)
          Severity: Minor
          Found in lib/interpol/response_schema_validator.rb - About 35 mins to fix

            Method define_example_test has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                  def define_example_test(config, endpoint, definition, example, example_index)
            Severity: Minor
            Found in lib/interpol/test_helper.rb - About 35 mins to fix

              Method recursively_extend has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  def self.recursively_extend(object)
                    case object
                      when Array
                        object.each { |v| recursively_extend(v) }
                      when Mash
              Severity: Minor
              Found in lib/interpol/dynamic_struct.rb - About 25 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 adjusted_schema has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                    def adjusted_schema(schema)
                      adjusted_types = Array(schema['type']).inject([]) do |type_list, type|
                        type_string, options = if type.is_a?(Hash)
                          [type.fetch('type'), type]
                        else
              Severity: Minor
              Found in lib/interpol/request_params_parser.rb - About 25 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