gavinlaking/vedeu

View on GitHub

Showing 47 of 67 total issues

Method output has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

      def output
        Vedeu.timer("Drawing border: '#{name}'") do
          [
            (top if top?),
            (left if left?),
Severity: Minor
Found in lib/vedeu/borders/refresh.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 bordered_width has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

      def bordered_width
        return width unless border && enabled?

        if left? && right?
          width - 2
Severity: Minor
Found in lib/vedeu/geometries/area/area.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 bordered_height has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

      def bordered_height
        return height unless border && enabled?

        if top? && bottom?
          height - 2
Severity: Minor
Found in lib/vedeu/geometries/area/area.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 initialize has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def initialize(argv   = [],
                   stdin  = STDIN,
                   stdout = STDOUT,
                   stderr = STDERR,
                   kernel = Kernel)
Severity: Minor
Found in lib/vedeu/runtime/launcher.rb - About 35 mins to fix

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

          def self.build(context = nil,
                         model   = nil,
                         value   = '',
                         options = {},
                         &block)
    Severity: Minor
    Found in lib/vedeu/dsl/helpers/attributes.rb - About 35 mins to fix

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

          def self.execute!(argv = [],
                            stdin  = STDIN,
                            stdout = STDOUT,
                            stderr = STDERR,
                            kernel = Kernel)
      Severity: Minor
      Found in lib/vedeu/runtime/launcher.rb - About 35 mins to fix

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

              def initialize(context = nil,
                             model   = nil,
                             value   = '',
                             options = {},
                             &block)
        Severity: Minor
        Found in lib/vedeu/dsl/helpers/attributes.rb - About 35 mins to fix

          Method pair has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

                def pair
                  if maximised?
                    [1, default]
          
                  elsif bottom_aligned? || right_aligned?
          Severity: Minor
          Found in lib/vedeu/geometries/area/dimension.rb - About 35 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 switch_mode! has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

                def switch_mode!(mode = nil)
                  if present?(mode) && valid_mode?(mode)
                    Vedeu.configure { |config| config.terminal_mode = mode }
          
                  else
          Severity: Minor
          Found in lib/vedeu/terminal/mode.rb - About 35 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 7 (exceeds 5 allowed). Consider refactoring.
          Open

                def coerce
                  raise Vedeu::Error::InvalidSyntax unless hash?(value)
          
                  if colour? && hash?(colour)
                    Vedeu::Coercers::ColourAttributes.coerce(colour)
          Severity: Minor
          Found in lib/vedeu/coercers/colour_attributes.rb - About 35 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 stop has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

                def stop
                  log('Attempting to stop')
          
                  return not_enabled unless Vedeu.config.drb?
          
          
          Severity: Minor
          Found in lib/vedeu/distributed/server.rb - About 35 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 add_action has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

                def add_action(controller, action)
                  if present?(controller) && present?(action)
                    Vedeu.log(type:    :create,
                              message: "Action: ':#{action}' " \
                                       "(for ':#{controller}')")
          Severity: Minor
          Found in lib/vedeu/runtime/router.rb - About 35 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 read has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

                def read
                  keys = console.getch
          
                  if keys.ord == Vedeu::ESCAPE_KEY_CODE
                    keys << console.read_nonblock(4) rescue nil
          Severity: Minor
          Found in lib/vedeu/input/raw.rb - About 35 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 7 (exceeds 5 allowed). Consider refactoring.
          Open

                def coerce
                  if coerced?
                    value
          
                  elsif value.is_a?(Vedeu::Models::Row)
          Severity: Minor
          Found in lib/vedeu/coercers/page.rb - About 35 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 width has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

                def width
                  if present?(options[:width])
                    options[:width]
          
                  elsif present?(options[:name])
          Severity: Minor
          Found in lib/vedeu/dsl/helpers/align.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 start_coordinate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

                def start_coordinate
                  if d_dn
                    (default - d_dn) < 1 ? 1 : (default - d_dn)
          
                  elsif d
          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 trigger has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

                def trigger(*args)
                  return execute(*args) unless debouncing? || throttling?
          
                  return execute(*args) if debouncing? && debounce_expired?
          
          
          Severity: Minor
          Found in lib/vedeu/events/event.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 value.nil? || coerced?
                    value
          
                  elsif tuple?
          Severity: Minor
          Found in lib/vedeu/coercers/position.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 items has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

                def items
                  items = []
                  collection.each_with_index do |item, index|
                    items << if index == @current && index == @selected
                               [true, true, item]
          Severity: Minor
          Found in lib/vedeu/menus/menu.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 _dn has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

                def _dn
                  if dn
                    dn
          
                  elsif d.nil? && d_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

          Severity
          Category
          Status
          Source
          Language