MiraitSystems/enju_trunk

View on GitHub

Showing 804 of 1,155 total issues

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

    def back_to_index(options = {})
      if options == nil
        options = {}
      else
        options.reject!{|key, value| value.blank?}
Severity: Minor
Found in lib/enju_trunk/enju_trunk_helper.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 to_sunspot_match_ahead has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def to_sunspot_match_ahead(key, field, val)
    # 既定の桁より大きい場合、または、数値でない文字列の場合エラー
    # 数値でない文字列には空白がある場合も含むので複数指定はエラーとなる
    # このチェックはANY検索の時外す
    if NUM_CHECK.include?(key) then
Severity: Minor
Found in lib/enju_leaf/openurl.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 import has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def import(filename)
    lines = 0
    clearManifestations
    @languages = Language.all
    @carriertypes = CarrierType.all
Severity: Minor
Found in lib/enju_trunk/xml2db_service.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 comp_date has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def comp_date(date)
    if date
      text = date.terms[0]
      date_text = case text
      when /\A\d{4}-\d{2}-\d{2}\Z/
Severity: Minor
Found in lib/enju_leaf/porta_cql.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