alxndr/lyriki

View on GitHub

Showing 7 of 7 total issues

Block has too many lines. [26/25]
Open

describe Lyriki::Legacy::SongData, vcr: { record: :none } do

  subject { Lyriki::Legacy::SongData.new artist: "frank zappa", song: "inca roads" }

  describe "#response_data" do

This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.

Unnecessary utf-8 encoding comment.
Open

# coding: utf-8
Severity: Minor
Found in lyriki.gemspec by rubocop

Add an empty line after magic comments.
Open

lib = File.expand_path("../lib", __FILE__)
Severity: Minor
Found in lyriki.gemspec by rubocop

Checks for a newline after the final magic comment.

Example:

# good
# frozen_string_literal: true

# Some documentation for Person
class Person
  # Some code
end

# bad
# frozen_string_literal: true
# Some documentation for Person
class Person
  # Some code
end

Place the end statement of a multi-line method on its own line.
Open

class NoLyricsError < StandardError; end
Severity: Minor
Found in lib/lyriki/legacy/song_data.rb by rubocop

This cop checks for trailing code after the method definition.

Example:

# bad
def some_method
do_stuff; end

def do_this(x)
  baz.map { |b| b.this(x) } end

def foo
  block do
    bar
  end end

# good
def some_method
  do_stuff
end

def do_this(x)
  baz.map { |b| b.this(x) }
end

def foo
  block do
    bar
  end
end

required_ruby_version (2.0, declared in lyriki.gemspec) and TargetRubyVersion (2.1, declared in .rubocop.yml) should be equal.
Open

  s.required_ruby_version = ">= 2.0"
Severity: Minor
Found in lyriki.gemspec by rubocop

Checks that required_ruby_version of gemspec and TargetRubyVersion of .rubocop.yml are equal. Thereby, RuboCop to perform static analysis working on the version required by gemspec.

Example:

# When `TargetRubyVersion` of .rubocop.yml is `2.3`.

# bad
Gem::Specification.new do |spec|
  spec.required_ruby_version = '>= 2.2.0'
end

# bad
Gem::Specification.new do |spec|
  spec.required_ruby_version = '>= 2.4.0'
end

# good
Gem::Specification.new do |spec|
  spec.required_ruby_version = '>= 2.3.0'
end

# good
Gem::Specification.new do |spec|
  spec.required_ruby_version = '>= 2.3'
end

# good
Gem::Specification.new do |spec|
  spec.required_ruby_version = ['>= 2.3.0', '< 2.5.0']
end

Favor modifier if usage when having a single-line body. Another good alternative is the usage of control flow &&/||.
Open

        if song_data["lyrics"] == "Not found"
Severity: Minor
Found in lib/lyriki/legacy/song_lyrics.rb by rubocop

Checks for if and unless statements that would fit on one line if written as a modifier if/unless. The maximum line length is configured in the Metrics/LineLength cop.

Example:

# bad
if condition
  do_stuff(bar)
end

unless qux.empty?
  Foo.do_something
end

# good
do_stuff(bar) if condition
Foo.do_something unless qux.empty?

Place the end statement of a multi-line method on its own line.
Open

class EditUrlError < StandardError; end
Severity: Minor
Found in lib/web_helpers.rb by rubocop

This cop checks for trailing code after the method definition.

Example:

# bad
def some_method
do_stuff; end

def do_this(x)
  baz.map { |b| b.this(x) } end

def foo
  block do
    bar
  end end

# good
def some_method
  do_stuff
end

def do_this(x)
  baz.map { |b| b.this(x) }
end

def foo
  block do
    bar
  end
end
Severity
Category
Status
Source
Language