moviepilot/lacerda

View on GitHub

Showing 28 of 28 total issues

Avoid too many return statements within this method.
Open

              return _e(:ERR_MISSING_PROPERTY, location, property) unless publish['properties'][property]
Severity: Major
Found in lib/lacerda/compare/json_schema.rb - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

             return _e(:ERR_MISSING_POINTER, location, publish['$ref']) unless resolved_publish
    Severity: Major
    Found in lib/lacerda/compare/json_schema.rb - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                return _e(:ERR_NOT_SUPPORTED, location, nil)
      Severity: Major
      Found in lib/lacerda/compare/json_schema.rb - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                return _e(:ERR_MISSING_REQUIRED, location, missing.to_json) unless missing.empty?
        Severity: Major
        Found in lib/lacerda/compare/json_schema.rb - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                          return false
          Severity: Major
          Found in lib/lacerda/compare/json_schema.rb - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                          return _e(:ERR_MISSING_SINGLE_PUBLISH_MULTI_CONSUME, location, publish['type'])
            Severity: Major
            Found in lib/lacerda/compare/json_schema.rb - About 30 mins to fix

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

                    def resolve_pointer(pointer, schema)
                      type = pointer[/\#\/definitions\/([^\/]+)$/, 1]
                      return false unless type
                      # TODO: Not so sure if we should raise an error
                      # when schema['definitions'] is missing?
              Severity: Minor
              Found in lib/lacerda/compare/json_schema.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 consume_specification_satisfied has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                    def consume_specification_satisfied(consumer, is_valid)
                      @consumers += 1
                      if is_valid
                        @io.print "#{consumer.name.camelize.green} " if @verbose
                      else
              Severity: Minor
              Found in lib/lacerda/reporters/stdout.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