rambler-digital-solutions/Generamba

View on GitHub

Showing 840 of 840 total issues

Tab detected.
Open

            puts 'Module successfully created!'
Severity: Minor
Found in lib/generamba/module_generator.rb by rubocop

Use the new Ruby 1.9 hash syntax.
Open

    method_option :description, :aliases => '-d', :desc => 'Provides a full description to the module'
Severity: Minor
Found in lib/generamba/cli/gen_command.rb by rubocop

This cop checks hash literal syntax.

It can enforce either the use of the class hash rocket syntax or the use of the newer Ruby 1.9 syntax (when applicable).

A separate offense is registered for each problematic pair.

The supported styles are:

  • ruby19 - forces use of the 1.9 syntax (e.g. {a: 1}) when hashes have all symbols for keys
  • hash_rockets - forces use of hash rockets for all hashes
  • nomixedkeys - simply checks for hashes with mixed syntaxes
  • ruby19nomixed_keys - forces use of ruby 1.9 syntax and forbids mixed syntax hashes

Example: EnforcedStyle: ruby19 (default)

# bad
{:a => 2}
{b: 1, :c => 2}

# good
{a: 2, b: 1}
{:c => 2, 'd' => 2} # acceptable since 'd' isn't a symbol
{d: 1, 'e' => 2} # technically not forbidden

Example: EnforcedStyle: hash_rockets

# bad
{a: 1, b: 2}
{c: 1, 'd' => 5}

# good
{:a => 1, :b => 2}

Example: EnforcedStyle: nomixedkeys

# bad
{:a => 1, b: 2}
{c: 1, 'd' => 2}

# good
{:a => 1, :b => 2}
{c: 1, d: 2}

Example: EnforcedStyle: ruby19nomixed_keys

# bad
{:a => 1, :b => 2}
{c: 2, 'd' => 3} # should just use hash rockets

# good
{a: 1, b: 2}
{:c => 3, 'd' => 4}

Tab detected.
Open

                                                                                                                file_name,
Severity: Minor
Found in lib/generamba/module_generator.rb by rubocop

Tab detected.
Open

            # Setting up Xcode objects
Severity: Minor
Found in lib/generamba/module_generator.rb by rubocop

Tab detected.
Open

                    file_group = dir_path.join(directory_name)
Severity: Minor
Found in lib/generamba/module_generator.rb by rubocop

Space missing after comma.
Open

        test_target = ask_index("Select the appropriate target for adding your TESTS (type the index):\n" + targets_prompt,project.targets)
Severity: Minor
Found in lib/generamba/cli/setup_command.rb by rubocop

Checks for comma (,) not followed by some kind of space.

Example:

# bad
[1,2]
{ foo:bar,}

# good
[1, 2]
{ foo:bar, }

Prefer the use of the nil? predicate.
Open

            if targets.count == 0 || files == nil || files.count == 0 || dir_path == nil || group_path == nil
Severity: Minor
Found in lib/generamba/module_generator.rb by rubocop

This cop checks for comparison of something with nil using ==.

Example:

# bad
if x == nil
end

# good
if x.nil?
end

Tab detected.
Open

            if code_module.project_targets && code_module.project_group_path && code_module.project_file_path
Severity: Minor
Found in lib/generamba/module_generator.rb by rubocop

Unnecessary spacing detected.
Open

          next_group = group_is_logical ?  final_group.new_group(group_name) : final_group.new_group(group_name, group_name)

This cop checks for extra/unnecessary whitespace.

Example:

# good if AllowForAlignment is true
name      = "RuboCop"
# Some comment and an empty line

website  += "/bbatsov/rubocop" unless cond
puts        "rubocop"          if     debug

# bad for any configuration
set_app("RuboCop")
website  = "https://github.com/bbatsov/rubocop"

Tab detected.
Open

            end
Severity: Minor
Found in lib/generamba/module_generator.rb by rubocop

Missing top-level class documentation comment.
Open

  class Template < Thor

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

Tab detected.
Open

                                                                code_module.project_targets,
Severity: Minor
Found in lib/generamba/module_generator.rb by rubocop

Line is too long. [125/80]
Open

      module_group = self.retrieve_group_or_create_if_needed(group_path, dir_path, file_group_path, project, true, root_path)

Line is too long. [116/80]
Open

      module_group = self.retrieve_group_or_create_if_needed(group_path, nil, nil, project, false, group_is_logical)

Tab detected.
Open

                puts('Creating test files...')
Severity: Minor
Found in lib/generamba/module_generator.rb by rubocop

Avoid multi-line chains of blocks.
Open

      }.each { |template_name|

This cop checks for chaining of a block after another block that spans multiple lines.

Example:

Thread.list.find_all do |t|
  t.alive?
end.map do |t|
  t.object_id
end

Tab detected.
Open

    end
Severity: Minor
Found in lib/generamba/module_generator.rb by rubocop

Tab detected.
Open

            puts "Test group path: #{code_module.test_group_path}".green if code_module.test_group_path
Severity: Minor
Found in lib/generamba/module_generator.rb by rubocop

Extra empty line detected at class body beginning.
Open


    desc 'install', 'Installs all the templates specified in the Rambafile from the current directory'

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

Example: EnforcedStyle: empty_lines

# good

class Foo

  def bar
    # ...
  end

end

Example: EnforcedStyle: emptylinesexcept_namespace

# good

class Foo
  class Bar

    # ...

  end
end

Example: EnforcedStyle: emptylinesspecial

# good
class Foo

  def bar; end

end

Example: EnforcedStyle: noemptylines (default)

# good

class Foo
  def bar
    # ...
  end
end

Tab detected.
Open

        def process_files_if_needed(files, code_module, template, project, targets, group_path, dir_path, root_path, processed_groups = [])
Severity: Minor
Found in lib/generamba/module_generator.rb by rubocop
Severity
Category
Status
Source
Language