crowbar/crowbar-core

View on GitHub

Showing 6,062 of 6,062 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

            top = (parseInt(that.element.css("top"), 10) + (that.position.top - that.originalPosition.top)) || null;
Severity: Minor
Found in crowbar_framework/vendor/assets/javascripts/jquery/ui.js and 1 other location - About 45 mins to fix
crowbar_framework/vendor/assets/javascripts/jquery/ui.js on lines 3414..3414

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 50.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

      if (self.duplicateEntry()) {
        self.root.after(
          $.dangerMessage(
            self.options.duplicate,
            true,
crowbar_framework/vendor/assets/javascripts/jquery/dynamicTable.js on lines 147..157

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 50.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

        begin
          unless nova_node.nil?
            nova_node.wait_for_script_to_finish(
              "/usr/sbin/crowbar-delete-unknown-nova-services.sh",
              timeouts[:delete_nova_services]
Severity: Major
Found in crowbar_framework/app/models/api/upgrade.rb and 2 other locations - About 45 mins to fix
crowbar_framework/app/models/api/upgrade.rb on lines 541..560
crowbar_framework/app/models/api/upgrade.rb on lines 582..601

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 40.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

      if (self.invalidEntry()) {
        self.root.after(
          $.dangerMessage(
            self.options.invalid,
            true,
crowbar_framework/vendor/assets/javascripts/jquery/dynamicTable.js on lines 159..169

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 50.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

                        case "m" : case "M" :
                            month += parseInt(matches[1],10);
                            day = Math.min(day, $.datepicker._getDaysInMonth(year, month));
                            break;
Severity: Minor
Found in crowbar_framework/vendor/assets/javascripts/jquery/ui.js and 1 other location - About 45 mins to fix
crowbar_framework/vendor/assets/javascripts/jquery/ui.js on lines 8277..8280

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 50.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    $document.delegate(rails.formSubmitSelector, 'ajax:complete.rails', function(event) {
      if (this == event.target) rails.enableFormElements($(this));
    });
Severity: Minor
Found in crowbar_framework/vendor/assets/javascripts/jquery/rails.js and 1 other location - About 45 mins to fix
crowbar_framework/vendor/assets/javascripts/jquery/rails.js on lines 456..458

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 50.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        this.element.find( ".ui-menu-item" )
            .removeClass( "ui-menu-item" )
            .removeAttr( "role" )
            .removeAttr( "aria-disabled" )
            .children( "a" )
Severity: Minor
Found in crowbar_framework/vendor/assets/javascripts/jquery/ui.js and 1 other location - About 45 mins to fix
crowbar_framework/vendor/assets/javascripts/jquery/ui.js on lines 5341..5351

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 50.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

  describe "Error creation" do
    let(:error) { Api::Error.new(error_attrs) }

    context "new error" do
      it "checks the type" do
Severity: Minor
Found in crowbar_framework/spec/models/api/error_spec.rb and 1 other location - About 45 mins to fix
crowbar_framework/spec/models/backup_spec.rb on lines 31..41

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 40.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

  def json_fixture(type, name)
    fixture = Rails.root.join("spec", "fixtures", "offline_chef", "#{type}_#{name}.json")
    File.read(fixture)
  rescue Errno::ENOENT
    warn "#{request.request_method} #{request.url} is missing a #{fixture}"
Severity: Minor
Found in crowbar_framework/spec/support/offline_chef.rb and 1 other location - About 45 mins to fix
crowbar_framework/spec/support/offline_couchdb.rb on lines 40..46

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 40.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

  def proposal_custom_button(proposal, options = {})
    parameters = {
      id: proposal.name,
      controller: proposal.barclamp
    }.merge options
Severity: Minor
Found in crowbar_framework/app/helpers/proposals_helper.rb and 1 other location - About 45 mins to fix
crowbar_framework/app/helpers/proposals_helper.rb on lines 114..124

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 40.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

  describe "Backup creation" do
    let(:backup) { Api::Backup.new(backup_attrs) }

    context "new backup" do
      it "checks the type" do
Severity: Minor
Found in crowbar_framework/spec/models/backup_spec.rb and 1 other location - About 45 mins to fix
crowbar_framework/spec/models/api/error_spec.rb on lines 12..22

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 40.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

  def json_fixture(type, name)
    fixture = Rails.root.join("spec", "fixtures", "offline_couchdb", "#{type}_#{name}.json")
    File.read(fixture)
  rescue Errno::ENOENT
    warn "#{request.request_method} #{request.url} is missing a #{fixture}"
Severity: Minor
Found in crowbar_framework/spec/support/offline_couchdb.rb and 1 other location - About 45 mins to fix
crowbar_framework/spec/support/offline_chef.rb on lines 138..144

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 40.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

  def proposal_raw_button(proposal, options = {})
    parameters = {
      id: proposal.name,
      controller: proposal.barclamp
    }.merge options
Severity: Minor
Found in crowbar_framework/app/helpers/proposals_helper.rb and 1 other location - About 45 mins to fix
crowbar_framework/app/helpers/proposals_helper.rb on lines 126..136

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 40.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 6 locations. Consider refactoring.
Open

    it "with quotes and spaces in options" do
      line = 'environment="MYVAR=I have a quote\" in my middle" ssh-rsa %s user4@example.net' % DUMMY_KEY_CONTENTS
      (options, type, key, comment) = DummyKeyParser.new.split_key_line(line)
      expect(options).to eq('environment="MYVAR=I have a quote\" in my middle"')
      expect(type).to eq("ssh-rsa")
Severity: Major
Found in crowbar_framework/spec/lib/crowbar/ssh_key_parser_spec.rb and 5 other locations - About 45 mins to fix
crowbar_framework/spec/lib/crowbar/ssh_key_parser_spec.rb on lines 57..63
crowbar_framework/spec/lib/crowbar/ssh_key_parser_spec.rb on lines 66..72
crowbar_framework/spec/lib/crowbar/ssh_key_parser_spec.rb on lines 84..90
crowbar_framework/spec/lib/crowbar/ssh_key_parser_spec.rb on lines 93..99
crowbar_framework/spec/lib/crowbar/ssh_key_parser_spec.rb on lines 102..108

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 39.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

    it "with spaces in comment" do
      line = "ssh-rsa %s comment with spaces user@example.net " % DUMMY_KEY_CONTENTS
      (options, type, key, comment) = DummyKeyParser.new.split_key_line(line)
      expect(options).to eq(nil)
      expect(type).to eq("ssh-rsa")
Severity: Major
Found in crowbar_framework/spec/lib/crowbar/ssh_key_parser_spec.rb and 2 other locations - About 45 mins to fix
crowbar_framework/spec/lib/crowbar/ssh_key_parser_spec.rb on lines 30..36
crowbar_framework/spec/lib/crowbar/ssh_key_parser_spec.rb on lines 39..45

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 39.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 6 locations. Consider refactoring.
Open

    it "with basic options" do
      line = 'from="*.sales.example.net,!pc.sales.example.net" ssh-rsa %s john@example.net' % DUMMY_KEY_CONTENTS
      (options, type, key, comment) = DummyKeyParser.new.split_key_line(line)
      expect(options).to eq('from="*.sales.example.net,!pc.sales.example.net"')
      expect(type).to eq("ssh-rsa")
Severity: Major
Found in crowbar_framework/spec/lib/crowbar/ssh_key_parser_spec.rb and 5 other locations - About 45 mins to fix
crowbar_framework/spec/lib/crowbar/ssh_key_parser_spec.rb on lines 66..72
crowbar_framework/spec/lib/crowbar/ssh_key_parser_spec.rb on lines 84..90
crowbar_framework/spec/lib/crowbar/ssh_key_parser_spec.rb on lines 93..99
crowbar_framework/spec/lib/crowbar/ssh_key_parser_spec.rb on lines 102..108
crowbar_framework/spec/lib/crowbar/ssh_key_parser_spec.rb on lines 111..117

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 39.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

    it "basic" do
      line = "ssh-rsa %s user@example.net" % DUMMY_KEY_CONTENTS
      (options, type, key, comment) = DummyKeyParser.new.split_key_line(line)
      expect(options).to eq(nil)
      expect(type).to eq("ssh-rsa")
Severity: Major
Found in crowbar_framework/spec/lib/crowbar/ssh_key_parser_spec.rb and 2 other locations - About 45 mins to fix
crowbar_framework/spec/lib/crowbar/ssh_key_parser_spec.rb on lines 39..45
crowbar_framework/spec/lib/crowbar/ssh_key_parser_spec.rb on lines 120..126

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 39.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 6 locations. Consider refactoring.
Open

    it "with mixed options with spaces" do
      line = 'command="dump /home",no-pty,no-port-forwarding ssh-rsa %s example.net' % DUMMY_KEY_CONTENTS
      (options, type, key, comment) = DummyKeyParser.new.split_key_line(line)
      expect(options).to eq('command="dump /home",no-pty,no-port-forwarding')
      expect(type).to eq("ssh-rsa")
Severity: Major
Found in crowbar_framework/spec/lib/crowbar/ssh_key_parser_spec.rb and 5 other locations - About 45 mins to fix
crowbar_framework/spec/lib/crowbar/ssh_key_parser_spec.rb on lines 57..63
crowbar_framework/spec/lib/crowbar/ssh_key_parser_spec.rb on lines 84..90
crowbar_framework/spec/lib/crowbar/ssh_key_parser_spec.rb on lines 93..99
crowbar_framework/spec/lib/crowbar/ssh_key_parser_spec.rb on lines 102..108
crowbar_framework/spec/lib/crowbar/ssh_key_parser_spec.rb on lines 111..117

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 39.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 6 locations. Consider refactoring.
Open

    it "with non-ssh-rsa type" do
      line = "no-touch-required sk-ecdsa-sha2-nistp256@openssh.com %s user3@example.net" % DUMMY_KEY_CONTENTS
      (options, type, key, comment) = DummyKeyParser.new.split_key_line(line)
      expect(options).to eq("no-touch-required")
      expect(type).to eq("sk-ecdsa-sha2-nistp256@openssh.com")
Severity: Major
Found in crowbar_framework/spec/lib/crowbar/ssh_key_parser_spec.rb and 5 other locations - About 45 mins to fix
crowbar_framework/spec/lib/crowbar/ssh_key_parser_spec.rb on lines 57..63
crowbar_framework/spec/lib/crowbar/ssh_key_parser_spec.rb on lines 66..72
crowbar_framework/spec/lib/crowbar/ssh_key_parser_spec.rb on lines 84..90
crowbar_framework/spec/lib/crowbar/ssh_key_parser_spec.rb on lines 93..99
crowbar_framework/spec/lib/crowbar/ssh_key_parser_spec.rb on lines 111..117

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 39.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 6 locations. Consider refactoring.
Open

    it "with options with spaces and comment" do
      line = 'tunnel="0",command="sh /etc/netstart tun0" ssh-rsa %s jane@example.net' % DUMMY_KEY_CONTENTS
      (options, type, key, comment) = DummyKeyParser.new.split_key_line(line)
      expect(options).to eq('tunnel="0",command="sh /etc/netstart tun0"')
      expect(type).to eq("ssh-rsa")
Severity: Major
Found in crowbar_framework/spec/lib/crowbar/ssh_key_parser_spec.rb and 5 other locations - About 45 mins to fix
crowbar_framework/spec/lib/crowbar/ssh_key_parser_spec.rb on lines 57..63
crowbar_framework/spec/lib/crowbar/ssh_key_parser_spec.rb on lines 66..72
crowbar_framework/spec/lib/crowbar/ssh_key_parser_spec.rb on lines 93..99
crowbar_framework/spec/lib/crowbar/ssh_key_parser_spec.rb on lines 102..108
crowbar_framework/spec/lib/crowbar/ssh_key_parser_spec.rb on lines 111..117

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 39.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Severity
Category
Status
Source
Language