fiedl/wingolfsplattform

View on GitHub
lib/importers/models/netenv_user.rb

Summary

Maintainability
F
4 days
Test Coverage

Class NetenvUser has 145 methods (exceeds 20 allowed). Consider refactoring.
Open

class NetenvUser

  # Rohdaten
  # =======================================================================

Severity: Major
Found in lib/importers/models/netenv_user.rb - About 2 days to fix

    File netenv_user.rb has 602 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    class NetenvUser
    
      # Rohdaten
      # =======================================================================
    
    
    Severity: Major
    Found in lib/importers/models/netenv_user.rb - About 1 day to fix

      Method last_known_status_group_in has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

        def last_known_status_group_in( corporation )
          status_name = last_known_status_in( corporation )
          
          group_name = "Hospitanten" if status_name == "Hospitant"
          group_name = "Kraßfuxen" if status_name == "Fux" || status_name == "Kraßfux"
      Severity: Minor
      Found in lib/importers/models/netenv_user.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 fix_netenv_aktivitätszahl_format has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

        def fix_netenv_aktivitätszahl_format(str)
          if str
            str = remove_brackets(str)
            str = str.gsub(";", ",")
            str = str.gsub(/^,/, "").gsub(/,$/, "")
      Severity: Minor
      Found in lib/importers/models/netenv_user.rb - About 55 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 type_of_study has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

        def type_of_study
          # "Bachelor/Master", "Diplom", "Kirchliche Prüfung", "Magister", "Promotion", "Staatsprüfung"
          type = data_hash_value :epdwingolfedustudystatus
          type = "Bachelor-Master-Studium"         if type == "Bachelor/Master"
          type = "Diplom-Studium"                  if type == "Diplom"
      Severity: Minor
      Found in lib/importers/models/netenv_user.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

      There are no issues that match your filters.

      Category
      Status