Codeminer42/cm42-central

View on GitHub

Showing 331 of 343 total issues

Prefer single-quoted strings when you don't need string interpolation or special symbols.
Open

    "Id", "Story", "Labels", "Iteration", "Iteration Start", "Iteration End",
Severity: Minor
Found in app/models/story.rb by rubocop

Prefer single-quoted strings when you don't need string interpolation or special symbols.
Open

    "Id", "Story", "Labels", "Iteration", "Iteration Start", "Iteration End",
Severity: Minor
Found in app/models/story.rb by rubocop

Prefer single-quoted strings when you don't need string interpolation or special symbols.
Open

    "Story Type", "Estimate", "Current State", "Started At", "Created at", "Accepted at",
Severity: Minor
Found in app/models/story.rb by rubocop

Line is too long. [117/100]
Open

            next_number       = backlog_iteration.number + 1 + (backlog_iteration.overflows_by / velocity_value).ceil
Severity: Minor
Found in app/services/iteration_service.rb by rubocop

Use day_difference.negative? instead of day_difference < 0.
Open

      day_difference += DAYS_IN_WEEK if day_difference < 0
Severity: Minor
Found in app/services/iteration_service.rb by rubocop

This cop checks for usage of comparison operators (==, >, <) to test numbers as zero, positive, or negative. These can be replaced by their respective predicate methods. The cop can also be configured to do the reverse.

The cop disregards nonzero? as it its value is truthy or falsey, but not true and false, and thus not always interchangeable with != 0.

Example:

# EnforcedStyle: predicate (default)

# bad

foo == 0
0 > foo
bar.baz > 0

# good

foo.zero?
foo.negative?
bar.baz.positive?

Example:

# EnforcedStyle: comparison

# bad

foo.zero?
foo.negative?
bar.baz.positive?

# good

foo == 0
0 > foo
bar.baz > 0

Prefer single-quoted strings when you don't need string interpolation or special symbols.
Open

    "Id", "Story", "Labels", "Iteration", "Iteration Start", "Iteration End",
Severity: Minor
Found in app/models/story.rb by rubocop

Rename is_admin? to admin?.
Open

  def is_admin?(user)
Severity: Minor
Found in app/models/team.rb by rubocop

This cop makes sure that predicates are named properly.

Example:

# bad
def is_even?(value) ...

# good
def even?(value)

# bad
def has_value? ...

# good
def value? ...

Prefer single-quoted strings when you don't need string interpolation or special symbols.
Open

           .where.not(state: "accepted").each do |story|

Place the . on the next line, together with the method name.
Open

          owner.last.group_by { |story| story.iteration_number }.
Severity: Minor
Found in app/services/iteration_service.rb by rubocop

Align select with @stories. on line 20.
Open

      select { |story| story.accepted_at < iteration_start_date(@current_time) }
Severity: Minor
Found in app/services/iteration_service.rb by rubocop

Space inside square brackets detected.
Open

    [ last_iteration_number, date_for_iteration_number(last_iteration_number) + project.iteration_length.days ]
Severity: Minor
Found in app/services/iteration_service.rb by rubocop

Space inside parentheses detected.
Open

    days_apart        = ( compare_date - iteration_start_date ) / 1.day
Severity: Minor
Found in app/services/iteration_service.rb by rubocop

Space inside parentheses detected.
Open

    days_apart        = ( compare_date - iteration_start_date ) / 1.day
Severity: Minor
Found in app/services/iteration_service.rb by rubocop

Space inside parentheses detected.
Open

        last_date = backlog_iterations.last.start_date + ( project.iteration_length * DAYS_IN_WEEK )
Severity: Minor
Found in app/services/iteration_service.rb by rubocop

Prefer single-quoted strings when you don't need string interpolation or special symbols.
Open

    "Id", "Story", "Labels", "Iteration", "Iteration Start", "Iteration End",
Severity: Minor
Found in app/models/story.rb by rubocop

Prefer single-quoted strings when you don't need string interpolation or special symbols.
Open

    "Deadline", "Requested By", "Owned By", "Description", "URL"
Severity: Minor
Found in app/models/story.rb by rubocop

Prefer single-quoted strings when you don't need string interpolation or special symbols.
Open

    "Deadline", "Requested By", "Owned By", "Description", "URL"
Severity: Minor
Found in app/models/story.rb by rubocop

Align .since with where("subject_type in ('Note', 'Task')") on line 32.
Open

      .since(since).to_a
Severity: Minor
Found in app/models/activity.rb by rubocop

Shadowing outer local variable - activities.
Open

            end.map do |subject_type, activities|
Severity: Minor
Found in app/models/activity.rb by rubocop

This cop looks for use of the same name as outer local variables for block arguments or block local variables. This is a mimic of the warning "shadowing outer local variable - foo" from ruby -cw.

Example:

# bad

def some_method
  foo = 1

  2.times do |foo| # shadowing outer `foo`
    do_something(foo)
  end
end

Example:

# good

def some_method
  foo = 1

  2.times do |bar|
    do_something(bar)
  end
end

Avoid multi-line chains of blocks.
Open

    end.map do |date, activities|
Severity: Minor
Found in app/models/activity.rb by rubocop

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
Severity
Category
Status
Source
Language