elthariel/activevlc

View on GitHub

Showing 4 of 4 total issues

Method on has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    def on(types, &block)
      event_is_valid = true
      types = [types] unless types.is_a? Array
      # Get the enum value if we gat a Symbol or String

Severity: Minor
Found in lib/activevlc/libvlc/event_manager.rb - About 1 hr 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 render_fragment has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    def render_fragment(k, h)
      map = h.map do |key, value|
        if value.nil?
          "#{key}"
        elsif value == false
Severity: Minor
Found in lib/activevlc/stage/base.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 _load_pipe has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    def _load_pipe(path, *inputs)
      if File.readable?(path)
        begin
          pipe = eval(File.read(path))
          pipe.input << inputs
Severity: Minor
Found in lib/activevlc/cli/pipe.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 to has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def to(sym_or_hash, &block)
      if sym_or_hash.is_a?(Hash)
        type, opt = sym_or_hash.first
      else
        type, opt = [sym_or_hash]
Severity: Minor
Found in lib/activevlc/dsl/stream.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

Severity
Category
Status
Source
Language