autotelik/datashift

View on GitHub
lib/datashift/column_packer.rb

Summary

Maintainability
A
55 mins
Test Coverage

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

    def record_to_column(record, json = false)

      return '' if record.nil? || (record.respond_to?(:each) && record.empty?)

      # :only and :except options can be used to limit the attributes included
Severity: Minor
Found in lib/datashift/column_packer.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

TODO found
Open

    # TODO: - better ways ?? - see transcoding and String#encode
Severity: Minor
Found in lib/datashift/column_packer.rb by fixme

Extra blank line detected.
Open


    end
Severity: Minor
Found in lib/datashift/column_packer.rb by rubocop

This cops checks for two or more consecutive blank lines.

Example:

# bad - It has two empty lines.
some_method
# one empty line
# two empty lines
some_method

# good
some_method
# one empty line
some_method

There are no issues that match your filters.

Category
Status