Codeminer42/cm42-central

View on GitHub

Showing 331 of 343 total issues

Line is too long. [103/100]
Open

        extra_iterations            = ( std_dev * iterations.size / mean_of_last_ten_iterations ).round
Severity: Minor
Found in app/services/iteration_service.rb by rubocop

Align the elements of a hash literal if they span more than one line.
Open

            user_name: matches[2],
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

Space inside parentheses detected.
Open

        extra_iterations            = ( std_dev * iterations.size / mean_of_last_ten_iterations ).round
Severity: Minor
Found in app/services/iteration_service.rb by rubocop

Line is too long. [110/100]
Open

      accepted = accepted.sort_by { |story| story.accepted_at }.group_by { |story| story.accepted_at.to_date }
Severity: Minor
Found in app/services/iteration_service.rb by rubocop

Line is too long. [111/100]
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

Avoid multi-line chains of blocks.
Open

      end.
      reduce({}) do |group, iteration|
Severity: Minor
Found in app/services/iteration_service.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

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

    @dummy_user ||= User.find_or_create_by!(username: "dummy", email: "dummy@foo.com", name: "Dummy", initials: "XX")
Severity: Minor
Found in app/services/iteration_service.rb by rubocop

Trailing whitespace detected.
Open

    return if record.action != 'update' 

Use next to skip iteration.
Open

        if %w[Note Comment].include?(header) && value
Severity: Minor
Found in app/models/story.rb by rubocop

Use next to skip iteration instead of a condition at the end.

Example:

# bad
[1, 2].each do |a|
  if a == 1
    puts a
  end
end

# good
[1, 2].each do |a|
  next unless a == 1
  puts a
end

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

Use a guard clause instead of wrapping the code inside a conditional expression.
Open

    if team_slug
Severity: Minor
Found in app/models/user.rb by rubocop

Use a guard clause instead of wrapping the code inside a conditional expression

Example:

# bad
def test
  if something
    work
  end
end

# good
def test
  return unless something
  work
end

# also good
def test
  work if something
end

# bad
if something
  raise 'exception'
else
  ok
end

# good
raise 'exception' if something
ok

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

      select { |record| record.owned_by.nil? }.
Severity: Minor
Found in app/services/iteration_service.rb by rubocop

Line is too long. [113/100]
Open

      ten_iterations_slice        = Statistics.slice_to_sample_size(group_by_velocity.values, STD_DEV_ITERATIONS)
Severity: Minor
Found in app/services/iteration_service.rb by rubocop

Align .includes with where("subject_type in ('Project', 'Story')") on line 28.
Open

      .includes(:user, :subject)
Severity: Minor
Found in app/models/activity.rb by rubocop

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

      .includes(:user, subject: [:story])
Severity: Minor
Found in app/models/activity.rb by rubocop

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

      end.
Severity: Minor
Found in app/services/iteration_service.rb by rubocop

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

      group_by { |story| story.iteration_number }.
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

Favor unless over if for negative conditions.
Open

          if !backlog_iteration.can_take_story?(story)
            # Iterations sometimes 'overflow', i.e. an iteration may contain a
            # 5 point story but the project velocity is 1.  In this case, the
            # next iteration that can have a story added is the current + 4.
            next_number       = backlog_iteration.number + 1 + (backlog_iteration.overflows_by / velocity_value).ceil
Severity: Minor
Found in app/services/iteration_service.rb by rubocop

Checks for uses of if with a negated condition. Only ifs without else are considered. There are three different styles:

- both
- prefix
- postfix

Example:

# EnforcedStyle: both
# enforces `unless` for `prefix` and `postfix` conditionals

# good

unless foo
  bar
end

# bad

if !foo
  bar
end

# good

bar unless foo

# bad

bar if !foo

Example:

# EnforcedStyle: prefix
# enforces `unless` for just `prefix` conditionals

# good

unless foo
  bar
end

# bad

if !foo
  bar
end

# good

bar if !foo

Example:

# EnforcedStyle: postfix
# enforces `unless` for just `postfix` conditionals

# good

bar unless foo

# bad

bar if !foo

# good

if !foo
  bar
end
Severity
Category
Status
Source
Language