doches/rwordnet

View on GitHub

Showing 4 of 392 total issues

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

    def expanded_hypernyms_depth
      parents = hypernyms.map{|hypernym| [hypernym, 1]}
      list = []
      out = []
      return list unless parents
Severity: Minor
Found in lib/rwordnet/synset.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 morphy has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def self.morphy(form, pos)
        if @exception_map == {}
            self.load_exception_map
        end
        exceptions = @exception_map[pos]
Severity: Minor
Found in lib/rwordnet/synset.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 expanded_first_hypernyms has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def expanded_first_hypernyms
      parent = hypernym
      list = []
      return list unless parent

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

    def expanded_hypernyms
      parents = hypernyms
      list = []
      return list unless parents

Severity: Minor
Found in lib/rwordnet/synset.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