rudionrails/yell

View on GitHub

Showing 5 of 7 total issues

Method initialize has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    def initialize( *args, &block )
      # extract options
      @options = args.last.is_a?(Hash) ? args.pop : {}

      # check if filename was given as argument and put it into the @options
Severity: Minor
Found in lib/yell/logger.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 to_sprintf has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def to_sprintf( table )
      buff, args, _pattern = "", [], @pattern.dup

      while true
        match = PatternMatcher.match(_pattern)
Severity: Minor
Found in lib/yell/formatter.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 write! has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def write!( event )
        # do nothing when not closing
        return super unless close?
        close

Severity: Minor
Found in lib/yell/adapters/datefile.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 interpret has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def interpret( severities )
      severities.split( ' ' ).each do |severity|
        if m = InterpretRegexp.match(severity)
          m[1].nil? ? __send__( :gte, m[2] ) : __send__( m[1], m[2] )
        end
Severity: Minor
Found in lib/yell/level.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 call has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def call( message )
        case
        when mod = @repository[message.class] || @repository[message.class.to_s]
          mod.call(message)
        when message.is_a?(Array)
Severity: Minor
Found in lib/yell/formatter.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