Showing 8 of 23 total issues
Class Configuration
has 37 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Configuration
attr_reader :endpoint_definition_files, :endpoints, :filter_example_data_blocks,
:endpoint_definition_merge_key_files
attr_accessor :validation_mode, :documentation_title
File endpoint.rb
has 304 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require 'forwardable'
require 'interpol/errors'
require 'json'
require 'json-schema'
require 'set'
Function show
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
, show: function () {
var $tip
, inside
, pos
, actualWidth
Function slide
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Open
def initialize(status, headers, body, env, config)
Method define_example_test
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def define_example_test(config, endpoint, definition, example, example_index)
Method recursively_extend
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
def self.recursively_extend(object)
case object
when Array
object.each { |v| recursively_extend(v) }
when Mash
- 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 adjusted_schema
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
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
- 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"