Genki-S/ttnt

View on GitHub

Showing 5 of 5 total issues

Method define_run_task has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    def define_run_task
      desc @run_description
      task 'run' do
        target_sha = ENV['TARGET_SHA']
        ts = TTNT::TestSelector.new(repo, target_sha, expanded_file_list)
Severity: Minor
Found in lib/ttnt/testtask.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 select_tests_from_patch has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def select_tests_from_patch(patch)
      target_lines = Set.new
      file = patch.delta.old_file[:path]
      prev_line = nil

Severity: Minor
Found in lib/ttnt/test_selector.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 select_tests! has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    def select_tests!
      # select all tests if anchored commit does not exist
      return Set.new(@test_files) unless @base_obj

      @tests ||= Set.new
Severity: Minor
Found in lib/ttnt/test_selector.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 get_tests has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def get_tests(file:, lineno:)
      tests = Set.new
      @mapping.each do |test, spectra|
        lines = spectra[file]
        next unless lines
Severity: Minor
Found in lib/ttnt/test_to_code_mapping.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 read_storage_content has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def read_storage_content
      if @sha
        if oid = storage_file_oid
          @repo.lookup(oid).content
        else
Severity: Minor
Found in lib/ttnt/storage.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