autotelik/datashift

View on GitHub
lib/datashift/excel_base.rb

Summary

Maintainability
A
1 hr
Test Coverage

Method parse_headers has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def parse_headers( sheet, header_row_idx = 0 )

      headers = DataShift::Headers.new(:excel, header_row_idx)

      header_row = sheet.row(header_row_idx)
Severity: Minor
Found in lib/datashift/excel_base.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 open_excel has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def open_excel( file_name, options = {})

      @excel = DataShift::Excel.new

      @excel.open(file_name)
Severity: Minor
Found in lib/datashift/excel_base.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

TODO found
Open

    # TODO: DRY
Severity: Minor
Found in lib/datashift/excel_base.rb by fixme

TODO found
Open

      # TODO: - make more robust - currently end on first empty column
Severity: Minor
Found in lib/datashift/excel_base.rb by fixme

There are no issues that match your filters.

Category
Status