Showing 1,550 of 1,556 total issues

Line is too long. [109/100]
Open

        puts "fixing groupsets #{groupset_snapshot.id} : #{groupset_snapshot.year}#{groupset_snapshot.month}"
Severity: Minor
Found in lib/tasks/fix_groups.rake by rubocop

Line is too long. [128/100]
Open

    puts Dhis2Snapshot.all.select("id, kind, length(content::text) as contentlength").sort_by(&:contentlength).map(&:attributes)
Severity: Minor
Found in lib/tasks/snapshots.rake by rubocop

Trailing whitespace detected.
Open

      
Severity: Minor
Found in lib/tasks/data_test.rake by rubocop

This cop looks for trailing whitespace in the source code.

Example:

# The line in this example contains spaces after the 0.
# bad
x = 0

# The line in this example ends directly after the 0.
# good
x = 0

Missing magic comment # frozen_string_literal: true.
Open

namespace :fix_groups do
Severity: Minor
Found in lib/tasks/fix_groups.rake by rubocop

This cop is designed to help upgrade to after Ruby 3.0. It will add the comment # frozen_string_literal: true to the top of files to enable frozen string literals. Frozen string literals may be default after Ruby 3.0. The comment will be added below a shebang and encoding comment. The frozen string literal comment is only valid in Ruby 2.3+.

Example: EnforcedStyle: always (default)

# The `always` style will always add the frozen string literal comment
# to a file, regardless of the Ruby version or if `freeze` or `<<` are
# called on a string literal.
# bad
module Bar
  # ...
end

# good
# frozen_string_literal: true

module Bar
  # ...
end

Example: EnforcedStyle: never

# The `never` will enforce that the frozen string literal comment does
# not exist in a file.
# bad
# frozen_string_literal: true

module Baz
  # ...
end

# good
module Baz
  # ...
end

Please use Rails.root.join('path', 'to') instead.
Open

    output_directory = Rails.root.join("tmp/new_artefacts")
Severity: Minor
Found in lib/tasks/data_test.rake by rubocop

This cop is used to identify usages of file path joining process to use Rails.root.join clause. It is used to add uniformity when joining paths.

Example: EnforcedStyle: arguments (default)

# bad
Rails.root.join('app/models/goober')
File.join(Rails.root, 'app/models/goober')
"#{Rails.root}/app/models/goober"

# good
Rails.root.join('app', 'models', 'goober')

Example: EnforcedStyle: slashes

# bad
Rails.root.join('app', 'models', 'goober')
File.join(Rails.root, 'app/models/goober')
"#{Rails.root}/app/models/goober"

# good
Rails.root.join('app/models/goober')

Line is too long. [111/100]
Open

            included_in_reference = contract_group_set_reference["organisation_unit_groups"].include?(to_check)
Severity: Minor
Found in lib/tasks/compare_pyramids.rake by rubocop

Line is too long. [108/100]
Open

      project_anchor.dhis2_snapshots.where(kind: "organisation_unit_group_sets").each do |groupset_snapshot|
Severity: Minor
Found in lib/tasks/fix_groups.rake by rubocop

Redundant begin block detected.
Open

      begin
Severity: Minor
Found in lib/tasks/data_test.rake by rubocop

This cop checks for redundant begin blocks.

Currently it checks for code like this:

Example:

# bad
def redundant
  begin
    ala
    bala
  rescue StandardError => e
    something
  end
end

# good
def preferred
  ala
  bala
rescue StandardError => e
  something
end

# bad
# When using Ruby 2.5 or later.
do_something do
  begin
    something
  rescue => ex
    anything
  end
end

# good
# In Ruby 2.5 or later, you can omit `begin` in `do-end` block.
do_something do
  something
rescue => ex
  anything
end

# good
# Stabby lambdas don't support implicit `begin` in `do-end` blocks.
-> do
  begin
    foo
  rescue Bar
    baz
  end
end

TODO found
Open

        # TODO:  compare reference period with db, tell that the data is no more in the same state

TODO found
Open

  # TODO: Refactor away the expensiveness
Severity: Minor
Found in app/models/package.rb by fixme
Severity
Category
Status
Source
Language