GlobalNamesArchitecture/gn_crossmap

View on GitHub

Showing 7 of 7 total issues

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

    def initialize(csv_io, input_name, skip_original, alt_headers, stats)
Severity: Minor
Found in lib/gn_crossmap/reader.rb - About 35 mins to fix

    Method read_line has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        def read_line(csv, data_collector)
          row = csv.readline
          return false if row.nil?
          row = process_headers(row) if @original_fields.nil?
          data_collector.process_row(row)
    Severity: Minor
    Found in lib/gn_crossmap/reader.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 has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        def process(csv, data_collector)
          counter = 0
          loop do
            yield @stats.stats if log_progress(counter) && block_given?
            rl = read_line(csv, data_collector)
    Severity: Minor
    Found in lib/gn_crossmap/reader.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 traverse_jobs has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        def traverse_jobs(data)
          until data.empty? && @jobs.compact.empty?
            process_results(data)
            cmd = yield(@stats.stats) if block_given?
            break if cmd == "STOP"
    Severity: Minor
    Found in lib/gn_crossmap/resolver.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 iogen has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        def iogen(arg, mode)
          if arg.nil? || arg == "-"
            mode == INPUT_MODE ? stdin : STDOUT
          else
            fd_i = IO.sysopen(arg, mode)
    Severity: Minor
    Found in lib/gn_crossmap.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 process_results has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        def process_results(data)
          indices = []
          @jobs.each_with_index do |job, i|
            next if job.nil? || !job.complete?
            with_log do
    Severity: Minor
    Found in lib/gn_crossmap/resolver.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 opts_struct has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        def opts_struct(opts)
          resolver_url = "http://resolver.globalnames.org/name_resolvers.json"
          threads = opts[:threads].to_i
          opts[:threads] = threads.between?(1, 10) ? threads : 2
          with_classification = opts[:with_classification] ? true : false
    Severity: Minor
    Found in lib/gn_crossmap.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