GordonDiggs/rayons

View on GitHub
spec/models/discogs_importer_spec.rb

Summary

Maintainability
A
2 hrs
Test Coverage

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

describe DiscogsImporter, type: :model do
  describe "#import" do
    it "handles odd formats" do
      id = "3916848"
      url = "https://www.discogs.com/NOFX-The-Decline/release/3916848"

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.

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

  describe "#import" do
    it "handles odd formats" do
      id = "3916848"
      url = "https://www.discogs.com/NOFX-The-Decline/release/3916848"
      release = {

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.

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

    it "creates tracks" do
      id = "3916848"
      url = "https://www.discogs.com/NOFX-The-Decline/release/3916848"
      release = {
        "styles" => %w[Punk Ska],

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.

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

    it "creates an Item" do
      id = "3916848"
      url = "https://www.discogs.com/NOFX-The-Decline/release/3916848"
      release = {
        "styles" => %w[Punk Ska],

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.

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

    it "handles odd formats" do
      id = "3916848"
      url = "https://www.discogs.com/NOFX-The-Decline/release/3916848"
      release = {
        "styles" => %w[Punk Ska],

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.

File discogs_importer_spec.rb has 251 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require "spec_helper"

describe DiscogsImporter, type: :model do
  describe "#import" do
    it "handles odd formats" do
Severity: Minor
Found in spec/models/discogs_importer_spec.rb - About 2 hrs to fix

    Useless assignment to variable - id.
    Open

          id = "3916848"

    This cop checks for every useless assignment to local variable in every scope. The basic idea for this cop was from the warning of ruby -cw:

    assigned but unused variable - foo

    Currently this cop has advanced logic that detects unreferenced reassignments and properly handles varied cases such as branch, loop, rescue, ensure, etc.

    Example:

    # bad
    
    def some_method
      some_var = 1
      do_something
    end

    Example:

    # good
    
    def some_method
      some_var = 1
      do_something(some_var)
    end

    Space inside } missing.
    Open

              { "duration" => "18:00", "position" => "A1", "type_" => "track", "title" => "The Decline" }, { "duration" => "", "position" => "B1", "type_" => "track", "title" => "Clams Have Feelings Too" }, {"position"=>"", "type_"=>"track", "title"=>"", "duration"=>""}

    Checks that braces used for hash literals have or don't have surrounding space depending on configuration.

    Example: EnforcedStyle: space

    # The `space` style enforces that hash literals have
    # surrounding space.
    
    # bad
    h = {a: 1, b: 2}
    
    # good
    h = { a: 1, b: 2 }

    Example: EnforcedStyle: no_space

    # The `no_space` style enforces that hash literals have
    # no surrounding space.
    
    # bad
    h = { a: 1, b: 2 }
    
    # good
    h = {a: 1, b: 2}

    Example: EnforcedStyle: compact

    # The `compact` style normally requires a space inside
    # hash braces, with the exception that successive left
    # braces or right braces are collapsed together in nested hashes.
    
    # bad
    h = { a: { b: 2 } }
    
    # good
    h = { a: { b: 2 }}

    Space inside } missing.
    Open

              {"name" => "Box Set", "qty" => 1}, { "descriptions" => ["LP"], "text" => "Clear Vinyl", "name" => "Vinyl", "qty" => "1" }],

    Checks that braces used for hash literals have or don't have surrounding space depending on configuration.

    Example: EnforcedStyle: space

    # The `space` style enforces that hash literals have
    # surrounding space.
    
    # bad
    h = {a: 1, b: 2}
    
    # good
    h = { a: 1, b: 2 }

    Example: EnforcedStyle: no_space

    # The `no_space` style enforces that hash literals have
    # no surrounding space.
    
    # bad
    h = { a: 1, b: 2 }
    
    # good
    h = {a: 1, b: 2}

    Example: EnforcedStyle: compact

    # The `compact` style normally requires a space inside
    # hash braces, with the exception that successive left
    # braces or right braces are collapsed together in nested hashes.
    
    # bad
    h = { a: { b: 2 } }
    
    # good
    h = { a: { b: 2 }}

    Useless assignment to variable - id.
    Open

          id = "3916848"

    This cop checks for every useless assignment to local variable in every scope. The basic idea for this cop was from the warning of ruby -cw:

    assigned but unused variable - foo

    Currently this cop has advanced logic that detects unreferenced reassignments and properly handles varied cases such as branch, loop, rescue, ensure, etc.

    Example:

    # bad
    
    def some_method
      some_var = 1
      do_something
    end

    Example:

    # good
    
    def some_method
      some_var = 1
      do_something(some_var)
    end

    Surrounding space missing for operator =>.
    Open

              { "duration" => "18:00", "position" => "A1", "type_" => "track", "title" => "The Decline" }, { "duration" => "", "position" => "B1", "type_" => "track", "title" => "Clams Have Feelings Too" }, {"position"=>"", "type_"=>"track", "title"=>"", "duration"=>""}

    Checks that operators have space around them, except for ** which should not have surrounding space.

    Example:

    # bad
    total = 3*4
    "apple"+"juice"
    my_number = 38/4
    a ** b
    
    # good
    total = 3 * 4
    "apple" + "juice"
    my_number = 38 / 4
    a**b

    Space inside { missing.
    Open

              { "duration" => "18:00", "position" => "A1", "type_" => "track", "title" => "The Decline" }, { "duration" => "", "position" => "B1", "type_" => "track", "title" => "Clams Have Feelings Too" }, {"position"=>"", "type_"=>"track", "title"=>"", "duration"=>""}

    Checks that braces used for hash literals have or don't have surrounding space depending on configuration.

    Example: EnforcedStyle: space

    # The `space` style enforces that hash literals have
    # surrounding space.
    
    # bad
    h = {a: 1, b: 2}
    
    # good
    h = { a: 1, b: 2 }

    Example: EnforcedStyle: no_space

    # The `no_space` style enforces that hash literals have
    # no surrounding space.
    
    # bad
    h = { a: 1, b: 2 }
    
    # good
    h = {a: 1, b: 2}

    Example: EnforcedStyle: compact

    # The `compact` style normally requires a space inside
    # hash braces, with the exception that successive left
    # braces or right braces are collapsed together in nested hashes.
    
    # bad
    h = { a: { b: 2 } }
    
    # good
    h = { a: { b: 2 }}

    Useless assignment to variable - id.
    Open

          id = "3916848"

    This cop checks for every useless assignment to local variable in every scope. The basic idea for this cop was from the warning of ruby -cw:

    assigned but unused variable - foo

    Currently this cop has advanced logic that detects unreferenced reassignments and properly handles varied cases such as branch, loop, rescue, ensure, etc.

    Example:

    # bad
    
    def some_method
      some_var = 1
      do_something
    end

    Example:

    # good
    
    def some_method
      some_var = 1
      do_something(some_var)
    end

    Closing array brace must be on the line after the last array element when opening brace is on a separate line from the first array element.
    Open

              {"name" => "Box Set", "qty" => 1}, { "descriptions" => ["LP"], "text" => "Clear Vinyl", "name" => "Vinyl", "qty" => "1" }],

    This cop checks that the closing brace in an array literal is either on the same line as the last array element, or a new line.

    When using the symmetrical (default) style:

    If an array's opening brace is on the same line as the first element of the array, then the closing brace should be on the same line as the last element of the array.

    If an array's opening brace is on the line above the first element of the array, then the closing brace should be on the line below the last element of the array.

    When using the new_line style:

    The closing brace of a multi-line array literal must be on the line after the last element of the array.

    When using the same_line style:

    The closing brace of a multi-line array literal must be on the same line as the last element of the array.

    Example: EnforcedStyle: symmetrical (default)

    # bad
      [ :a,
        :b
      ]
    
      # bad
      [
        :a,
        :b ]
    
      # good
      [ :a,
        :b ]
    
      # good
      [
        :a,
        :b
      ]

    Example: EnforcedStyle: new_line

    # bad
      [
        :a,
        :b ]
    
      # bad
      [ :a,
        :b ]
    
      # good
      [ :a,
        :b
      ]
    
      # good
      [
        :a,
        :b
      ]

    Example: EnforcedStyle: same_line

    # bad
      [ :a,
        :b
      ]
    
      # bad
      [
        :a,
        :b
      ]
    
      # good
      [
        :a,
        :b ]
    
      # good
      [ :a,
        :b ]

    Surrounding space missing for operator =>.
    Open

              { "duration" => "18:00", "position" => "A1", "type_" => "track", "title" => "The Decline" }, { "duration" => "", "position" => "B1", "type_" => "track", "title" => "Clams Have Feelings Too" }, {"position"=>"", "type_"=>"track", "title"=>"", "duration"=>""}

    Checks that operators have space around them, except for ** which should not have surrounding space.

    Example:

    # bad
    total = 3*4
    "apple"+"juice"
    my_number = 38/4
    a ** b
    
    # good
    total = 3 * 4
    "apple" + "juice"
    my_number = 38 / 4
    a**b

    Surrounding space missing for operator =>.
    Open

              { "duration" => "18:00", "position" => "A1", "type_" => "track", "title" => "The Decline" }, { "duration" => "", "position" => "B1", "type_" => "track", "title" => "Clams Have Feelings Too" }, {"position"=>"", "type_"=>"track", "title"=>"", "duration"=>""}

    Checks that operators have space around them, except for ** which should not have surrounding space.

    Example:

    # bad
    total = 3*4
    "apple"+"juice"
    my_number = 38/4
    a ** b
    
    # good
    total = 3 * 4
    "apple" + "juice"
    my_number = 38 / 4
    a**b

    Surrounding space missing for operator =>.
    Open

              { "duration" => "18:00", "position" => "A1", "type_" => "track", "title" => "The Decline" }, { "duration" => "", "position" => "B1", "type_" => "track", "title" => "Clams Have Feelings Too" }, {"position"=>"", "type_"=>"track", "title"=>"", "duration"=>""}

    Checks that operators have space around them, except for ** which should not have surrounding space.

    Example:

    # bad
    total = 3*4
    "apple"+"juice"
    my_number = 38/4
    a ** b
    
    # good
    total = 3 * 4
    "apple" + "juice"
    my_number = 38 / 4
    a**b

    Space inside { missing.
    Open

              {"name" => "Box Set", "qty" => 1}, { "descriptions" => ["LP"], "text" => "Clear Vinyl", "name" => "Vinyl", "qty" => "1" }],

    Checks that braces used for hash literals have or don't have surrounding space depending on configuration.

    Example: EnforcedStyle: space

    # The `space` style enforces that hash literals have
    # surrounding space.
    
    # bad
    h = {a: 1, b: 2}
    
    # good
    h = { a: 1, b: 2 }

    Example: EnforcedStyle: no_space

    # The `no_space` style enforces that hash literals have
    # no surrounding space.
    
    # bad
    h = { a: 1, b: 2 }
    
    # good
    h = {a: 1, b: 2}

    Example: EnforcedStyle: compact

    # The `compact` style normally requires a space inside
    # hash braces, with the exception that successive left
    # braces or right braces are collapsed together in nested hashes.
    
    # bad
    h = { a: { b: 2 } }
    
    # good
    h = { a: { b: 2 }}

    There are no issues that match your filters.

    Category
    Status