ikuseiGmbH/Goldencobra

View on GitHub
app/models/goldencobra/articletype_group.rb

Summary

Maintainability
A
0 mins
Test Coverage

Goldencobra::ArticletypeGroup has no descriptive comment
Open

  class ArticletypeGroup < ActiveRecord::Base

Classes and modules are the units of reuse and release. It is therefore considered good practice to annotate every class and module with a brief comment outlining its responsibilities.

Example

Given

class Dummy
  # Do things...
end

Reek would emit the following warning:

test.rb -- 1 warning:
  [1]:Dummy has no descriptive comment (IrresponsibleModule)

Fixing this is simple - just an explaining comment:

# The Dummy class is responsible for ...
class Dummy
  # Do things...
end

Missing top-level class documentation comment.
Open

  class ArticletypeGroup < ActiveRecord::Base

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

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

module Goldencobra

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.

Unnecessary utf-8 encoding comment.
Open

# encoding: utf-8

This cop checks ensures source files have no utf-8 encoding comments.

Example:

# bad
# encoding: UTF-8
# coding: UTF-8
# -*- coding: UTF-8 -*-

There are no issues that match your filters.

Category
Status