dphaener/kanji

View on GitHub
lib/kanji/generators/project.rb

Summary

Maintainability
A
0 mins
Test Coverage

Class has too many lines. [117/100]
Wontfix

    class Project < AbstractGenerator
      def initialize(app_name, options = {})
        @app_name = app_name
        super(underscored_project_name)
      end
Severity: Minor
Found in lib/kanji/generators/project.rb by rubocop

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

Use 2 spaces for indentation in a heredoc by using some library(e.g. ActiveSupport's String#strip_heredoc).
Open

\n
You're now ready to start writing your Kanji app! Congratulations!
Because this is a data driven API application, you can't do much
with it until you create some types! Get started by using a generator:
`kanji g type User email:string`
Severity: Minor
Found in lib/kanji/generators/project.rb by rubocop

This cops checks the indentation of the here document bodies. The bodies are indented one step. In Ruby 2.3 or newer, squiggly heredocs (<<~) should be used. If you use the older rubies, you should introduce some library to your project (e.g. ActiveSupport, Powerpack or Unindent). Note: When Metrics/LineLength's AllowHeredoc is false(not default), this cop does not add any offenses for long here documents to avoid Metrics/LineLength's offenses.

Example:

# bad
<<-RUBY
something
RUBY

# good
# When EnforcedStyle is squiggly, bad code is auto-corrected to the
# following code.
<<~RUBY
  something
RUBY

# good
# When EnforcedStyle is active_support, bad code is auto-corrected to
# the following code.
<<-RUBY.strip_heredoc
  something
RUBY

Unused method argument - options. If it's necessary, use _ or _options as an argument name to indicate that it won't be used.
Open

      def initialize(app_name, options = {})
Severity: Minor
Found in lib/kanji/generators/project.rb by rubocop

This cop checks for unused method arguments.

Example:

# bad

def some_method(used, unused, _unused_but_allowed)
  puts used
end

Example:

# good

def some_method(used, _unused, _unused_but_allowed)
  puts used
end

Line is too long. [109/100]
Open

        add_template("system/project/application.rb.tt", "system/#{underscored_project_name}/application.rb")
Severity: Minor
Found in lib/kanji/generators/project.rb by rubocop

Keep a blank line before and after private.
Open

      private
Severity: Minor
Found in lib/kanji/generators/project.rb by rubocop

Access modifiers should be surrounded by blank lines.

Example:

# bad
class Foo
  def bar; end
  private
  def baz; end
end

# good
class Foo
  def bar; end

  private

  def baz; end
end

Line is too long. [105/100]
Open

        add_template("system/project/container.rb.tt", "system/#{underscored_project_name}/container.rb")
Severity: Minor
Found in lib/kanji/generators/project.rb by rubocop

Line is too long. [103/100]
Open

        add_template("system/project/settings.rb.tt", "system/#{underscored_project_name}/settings.rb")
Severity: Minor
Found in lib/kanji/generators/project.rb by rubocop

There are no issues that match your filters.

Category
Status