FHG-IMW/epo-ops

View on GitHub

Showing 6 of 6 total issues

Method initialize has 9 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def initialize(name, address1, address2, address3, address4,
                   address5, country_code, cdsid, occurred_on= nil)
Severity: Major
Found in lib/epo_ops/name_and_address.rb - About 1 hr to fix

    Method flat_dig has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        def self.flat_dig(data,*path)
          path.flatten.inject(data) do |d,key|
            if d.is_a? Hash
              d[key].is_a?(Array) ? d[key] : [d[key]]
            elsif d.is_a? Array
    Severity: Minor
    Found in lib/epo_ops/util.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 validate_range has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        def self.validate_range(range_start, range_end)
          range_start = 1 unless range_start
          range_end = 10 unless range_end
          if range_start > range_end
            range_start, range_end = range_end, range_start
    Severity: Minor
    Found in lib/epo_ops/search_query_builder.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 parse_hash_flat has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        def self.parse_hash_flat(hash_layer, target)
          result = []
          if hash_layer.nil?
            return []
          elsif hash_layer.class == String
    Severity: Minor
    Found in lib/epo_ops/util.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 request has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        def self.request(verb, url, options = {})
          EpoOps::Logger.debug("Sending Request: #{verb} #{url}")
          response = case EpoOps.config.authentication
                      when :oauth then do_oauth_request(verb, url, options)
                      when :plain then do_plain_request(verb,url,options)
    Severity: Minor
    Found in lib/epo_ops/client.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 process_file has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        def self.process_file(file)
          # Process every line (There is a line for every class entry, name and description are separated by a \t)
          file.each_line.inject(Hash.new { |h, k| h[k] = [] }) do |mem, line|
            next if line.to_s.strip.empty?
            ipc_class_generic, _description = line.split("\t")
    Severity: Minor
    Found in lib/epo_ops/ipc_class_hierarchy_loader.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