iagopiimenta/aws_secrets_loader

View on GitHub

Showing 8 of 8 total issues

AwsSecretsLoader::AwsFetcher#secret_names calls 'ENV['AWS_SECRET_NAME']' 2 times
Open

        ENV['AWS_SECRET_NAME'] ? ENV['AWS_SECRET_NAME'].split(',') : []
Severity: Minor
Found in lib/aws_secrets_loader/aws_fetcher.rb by reek

Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.

Reek implements a check for Duplicate Method Call.

Example

Here's a very much simplified and contrived example. The following method will report a warning:

def double_thing()
  @other.thing + @other.thing
end

One quick approach to silence Reek would be to refactor the code thus:

def double_thing()
  thing = @other.thing
  thing + thing
end

A slightly different approach would be to replace all calls of double_thing by calls to @other.double_thing:

class Other
  def double_thing()
    thing + thing
  end
end

The approach you take will depend on balancing other factors in your code.

AwsSecretsLoader has no descriptive comment
Open

module AwsSecretsLoader
Severity: Minor
Found in lib/aws_secrets_loader.rb by reek

Classes and modules are the units of reuse and release. It is therefore considered good practice to annotate every class and module with a brief comment outlining its responsibilities.

Example

Given

class Dummy
  # Do things...
end

Reek would emit the following warning:

test.rb -- 1 warning:
  [1]:Dummy has no descriptive comment (IrresponsibleModule)

Fixing this is simple - just an explaining comment:

# The Dummy class is responsible for ...
class Dummy
  # Do things...
end

AwsSecretsLoader::AwsFetcher#fetch_secrets calls 'secret_value.secret_string' 2 times
Open

        valid_json?(secret_value.secret_string) || { secret_name.to_s => secret_value.secret_string }
Severity: Minor
Found in lib/aws_secrets_loader/aws_fetcher.rb by reek

Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.

Reek implements a check for Duplicate Method Call.

Example

Here's a very much simplified and contrived example. The following method will report a warning:

def double_thing()
  @other.thing + @other.thing
end

One quick approach to silence Reek would be to refactor the code thus:

def double_thing()
  thing = @other.thing
  thing + thing
end

A slightly different approach would be to replace all calls of double_thing by calls to @other.double_thing:

class Other
  def double_thing()
    thing + thing
  end
end

The approach you take will depend on balancing other factors in your code.

AwsSecretsLoader::AwsFetcher has no descriptive comment
Open

  class AwsFetcher
Severity: Minor
Found in lib/aws_secrets_loader/aws_fetcher.rb by reek

Classes and modules are the units of reuse and release. It is therefore considered good practice to annotate every class and module with a brief comment outlining its responsibilities.

Example

Given

class Dummy
  # Do things...
end

Reek would emit the following warning:

test.rb -- 1 warning:
  [1]:Dummy has no descriptive comment (IrresponsibleModule)

Fixing this is simple - just an explaining comment:

# The Dummy class is responsible for ...
class Dummy
  # Do things...
end

AwsSecretsLoader::Railtie has no descriptive comment
Open

  class Railtie < Rails::Railtie
Severity: Minor
Found in lib/aws_secrets_loader/railtie.rb by reek

Classes and modules are the units of reuse and release. It is therefore considered good practice to annotate every class and module with a brief comment outlining its responsibilities.

Example

Given

class Dummy
  # Do things...
end

Reek would emit the following warning:

test.rb -- 1 warning:
  [1]:Dummy has no descriptive comment (IrresponsibleModule)

Fixing this is simple - just an explaining comment:

# The Dummy class is responsible for ...
class Dummy
  # Do things...
end

Line is too long. [87/80]
Open

  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
Severity: Minor
Found in aws_secrets_loader.gemspec by rubocop

Line is too long. [85/80]
Open

    `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
Severity: Minor
Found in aws_secrets_loader.gemspec by rubocop

Line is too long. [101/80]
Open

        valid_json?(secret_value.secret_string) || { secret_name.to_s => secret_value.secret_string }
Severity
Category
Status
Source
Language