gavinlaking/vedeu

View on GitHub

Showing 47 of 67 total issues

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

      def self.keymap(name, &block)
        raise Vedeu::Error::MissingRequired unless name
        raise Vedeu::Error::RequiresBlock unless block_given?

        unless Vedeu.keymaps.registered?(name)
Severity: Minor
Found in lib/vedeu/input/dsl.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 snake_case has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def snake_case(klass)
      str = klass.is_a?(Module) ? klass.name : klass

      str.split(/::/).map do |namespace|
        *upper, _ = namespace.split(/([A-Z]+)/).reject(&:empty?).map do |chars|
Severity: Minor
Found in lib/vedeu/common.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 lines has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def lines(opts = {}, &block)
        requires_block!(&block)
        requires_model!

        attrs = build_attributes(nil, opts, &block)
Severity: Minor
Found in lib/vedeu/dsl/elements.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 end_coordinate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def end_coordinate
        if d_dn
          (d_dn > default) ? default : d_dn

        elsif dn
Severity: Minor
Found in lib/vedeu/geometries/area/dimension.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 coerce has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def coerce
        if coerced?
          value

        elsif absent?(value)
Severity: Minor
Found in lib/vedeu/coercers/colour.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 escape_sequence has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def escape_sequence
        return '' if empty?

        if registered?(colour)
          retrieve(colour)
Severity: Minor
Found in lib/vedeu/colours/translator.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 compress has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def compress
          Vedeu.timer('Removing duplicate cells...') do
            content.map do |cell|
              character = character_for(cell)

Severity: Minor
Found in lib/vedeu/output/compressors/character.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