metaminded/tabulatr2

View on GitHub
lib/tabulatr/data/formatting.rb

Summary

Maintainability
A
0 mins
Test Coverage

Method has too many lines. [12/10]
Open

  def apply_formats(locals: {}, controller: nil)
    view = Tabulatr::Data::Proxy.new(locals: locals, controller: controller)
    return @relation.map do |record|
      view.record = record
      h = HashWithIndifferentAccess.new
Severity: Minor
Found in lib/tabulatr/data/formatting.rb by rubocop

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Assignment Branch Condition size for apply_formats is too high. [15.65/15]
Open

  def apply_formats(locals: {}, controller: nil)
    view = Tabulatr::Data::Proxy.new(locals: locals, controller: controller)
    return @relation.map do |record|
      view.record = record
      h = HashWithIndifferentAccess.new
Severity: Minor
Found in lib/tabulatr/data/formatting.rb by rubocop

This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

Redundant return detected.
Open

    return @relation.map do |record|
Severity: Minor
Found in lib/tabulatr/data/formatting.rb by rubocop

This cop checks for redundant return expressions.

Example:

def test
  return something
end

def test
  one
  two
  three
  return something
end

It should be extended to handle methods whose body is if/else or a case expression with a default branch.

Do not place comments on the same line as the end keyword.
Open

  end # apply_formats
Severity: Minor
Found in lib/tabulatr/data/formatting.rb by rubocop

This cop checks for comments put on the same line as some keywords. These keywords are: begin, class, def, end, module.

Note that some comments (such as :nodoc: and rubocop:disable) are allowed.

Example:

# bad
if condition
  statement
end # end if

# bad
class X # comment
  statement
end

# bad
def x; end # comment

# good
if condition
  statement
end

# good
class X # :nodoc:
  y
end

Extra empty line detected at module body beginning.
Open


  def apply_formats(locals: {}, controller: nil)
Severity: Minor
Found in lib/tabulatr/data/formatting.rb by rubocop

This cops checks if empty lines around the bodies of modules match the configuration.

Example: EnforcedStyle: empty_lines

# good

module Foo

  def bar
    # ...
  end

end

Example: EnforcedStyle: emptylinesexcept_namespace

# good

module Foo
  module Bar

    # ...

  end
end

Example: EnforcedStyle: emptylinesspecial

# good
module Foo

  def bar; end

end

Example: EnforcedStyle: noemptylines (default)

# good

module Foo
  def bar
    # ...
  end
end

Missing top-level module documentation comment.
Open

module Tabulatr::Data::Formatting
Severity: Minor
Found in lib/tabulatr/data/formatting.rb by rubocop

This cop checks for missing top-level documentation of classes and modules. Classes with no body are exempt from the check and so are namespace modules - modules that have nothing in their bodies except classes, other modules, or constant definitions.

The documentation requirement is annulled if the class or module has a "#:nodoc:" comment next to it. Likewise, "#:nodoc: all" does the same for all its children.

Example:

# bad
class Person
  # ...
end

# good
# Description/Explanation of Person class
class Person
  # ...
end

Line is too long. [83/80]
Open

    view.instance_exec(view.record, row_config.attributes, &row) if row.is_a?(Proc)
Severity: Minor
Found in lib/tabulatr/data/formatting.rb by rubocop

Do not place comments on the same line as the end keyword.
Open

    end # @relation map
Severity: Minor
Found in lib/tabulatr/data/formatting.rb by rubocop

This cop checks for comments put on the same line as some keywords. These keywords are: begin, class, def, end, module.

Note that some comments (such as :nodoc: and rubocop:disable) are allowed.

Example:

# bad
if condition
  statement
end # end if

# bad
class X # comment
  statement
end

# bad
def x; end # comment

# good
if condition
  statement
end

# good
class X # :nodoc:
  y
end

Use nested module/class definitions instead of compact style.
Open

module Tabulatr::Data::Formatting
Severity: Minor
Found in lib/tabulatr/data/formatting.rb by rubocop

This cop checks the style of children definitions at classes and modules. Basically there are two different styles:

Example: EnforcedStyle: nested (default)

# good
# have each child on its own line
class Foo
  class Bar
  end
end

Example: EnforcedStyle: compact

# good
# combine definitions as much as possible
class Foo::Bar
end

The compact style is only forced for classes/modules with one child.

There are no issues that match your filters.

Category
Status