axsh/wakame-vdc

View on GitHub

Showing 694 of 1,587 total issues

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

  get '/:id' do
    i = find_by_uuid(:Instance, params[:id])
    raise E::UnknownInstance, params[:id] if i.nil?

    respond_with(R::Instance.new(i).generate)
Severity: Minor
Found in dcmgr/lib/dcmgr/endpoints/12.03/instances.rb and 5 other locations - About 15 mins to fix
dcmgr/lib/dcmgr/endpoints/12.03/backup_storages.rb on lines 28..31
dcmgr/lib/dcmgr/endpoints/12.03/host_nodes.rb on lines 54..60
dcmgr/lib/dcmgr/endpoints/12.03/jobs.rb on lines 24..27
dcmgr/lib/dcmgr/endpoints/12.03/load_balancers.rb on lines 53..57
dcmgr/lib/dcmgr/endpoints/12.03/security_groups.rb on lines 39..44

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 25.

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

  get '/:id' do
    bkst = find_by_uuid(:BackupStorage, params[:id])
    raise E::UnknownBackupStorage, params[:id] if bkst.nil?
    respond_with(R::BackupStorage.new(bkst).generate)
Severity: Minor
Found in dcmgr/lib/dcmgr/endpoints/12.03/backup_storages.rb and 5 other locations - About 15 mins to fix
dcmgr/lib/dcmgr/endpoints/12.03/host_nodes.rb on lines 54..60
dcmgr/lib/dcmgr/endpoints/12.03/instances.rb on lines 180..184
dcmgr/lib/dcmgr/endpoints/12.03/jobs.rb on lines 24..27
dcmgr/lib/dcmgr/endpoints/12.03/load_balancers.rb on lines 53..57
dcmgr/lib/dcmgr/endpoints/12.03/security_groups.rb on lines 39..44

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 25.

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

  get '/:id' do
    job = find_by_uuid(:QueuedJob, params[:id])
    raise E::UnknownJob, params[:id] if job.nil?
    respond_with(R::QueuedJob.new(job).generate)
Severity: Minor
Found in dcmgr/lib/dcmgr/endpoints/12.03/jobs.rb and 5 other locations - About 15 mins to fix
dcmgr/lib/dcmgr/endpoints/12.03/backup_storages.rb on lines 28..31
dcmgr/lib/dcmgr/endpoints/12.03/host_nodes.rb on lines 54..60
dcmgr/lib/dcmgr/endpoints/12.03/instances.rb on lines 180..184
dcmgr/lib/dcmgr/endpoints/12.03/load_balancers.rb on lines 53..57
dcmgr/lib/dcmgr/endpoints/12.03/security_groups.rb on lines 39..44

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 25.

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

  get '/:id' do
    # description 'Show the security group'
    g = find_by_uuid(:SecurityGroup, params[:id])
    raise E::UnknownSecurityGroup, params[:id] if g.nil?

Severity: Minor
Found in dcmgr/lib/dcmgr/endpoints/12.03/security_groups.rb and 5 other locations - About 15 mins to fix
dcmgr/lib/dcmgr/endpoints/12.03/backup_storages.rb on lines 28..31
dcmgr/lib/dcmgr/endpoints/12.03/host_nodes.rb on lines 54..60
dcmgr/lib/dcmgr/endpoints/12.03/instances.rb on lines 180..184
dcmgr/lib/dcmgr/endpoints/12.03/jobs.rb on lines 24..27
dcmgr/lib/dcmgr/endpoints/12.03/load_balancers.rb on lines 53..57

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 25.

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

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

          match.each { |key,value|
            tag = match_tags[key]
            raise "No match tag: key:'#{key.inspect}'." if tag.nil?

            str << "," << tag % value
Severity: Minor
Found in dcmgr/lib/dcmgr/edge_networking/openflow/flow.rb and 1 other location - About 15 mins to fix
dcmgr/lib/dcmgr/edge_networking/openflow/flow.rb on lines 24..28

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 25.

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

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

          match.each { |key,value|
            tag = match_tags[key]
            raise "No match tag: key:'#{key.inspect}'." if tag.nil?

            str << "," << tag % value
Severity: Minor
Found in dcmgr/lib/dcmgr/edge_networking/openflow/flow.rb and 1 other location - About 15 mins to fix
dcmgr/lib/dcmgr/edge_networking/openflow/flow.rb on lines 36..40

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 25.

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

  get '/:id' do
    lb = find_by_uuid(:LoadBalancer, params[:id])
    raise E::UnknownLoadBalancer, params[:id] if lb.nil?

    respond_with(R::LoadBalancer.new(lb).generate)
Severity: Minor
Found in dcmgr/lib/dcmgr/endpoints/12.03/load_balancers.rb and 5 other locations - About 15 mins to fix
dcmgr/lib/dcmgr/endpoints/12.03/backup_storages.rb on lines 28..31
dcmgr/lib/dcmgr/endpoints/12.03/host_nodes.rb on lines 54..60
dcmgr/lib/dcmgr/endpoints/12.03/instances.rb on lines 180..184
dcmgr/lib/dcmgr/endpoints/12.03/jobs.rb on lines 24..27
dcmgr/lib/dcmgr/endpoints/12.03/security_groups.rb on lines 39..44

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 25.

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

  get '/:id' do
    # description 'Show status of the host'
    # param :account_id, :string, :optional
    hn = find_by_public_uuid(:HostNode, params[:id])
    raise E::UnknownHostNode, params[:id] if hn.nil?
Severity: Minor
Found in dcmgr/lib/dcmgr/endpoints/12.03/host_nodes.rb and 5 other locations - About 15 mins to fix
dcmgr/lib/dcmgr/endpoints/12.03/backup_storages.rb on lines 28..31
dcmgr/lib/dcmgr/endpoints/12.03/instances.rb on lines 180..184
dcmgr/lib/dcmgr/endpoints/12.03/jobs.rb on lines 24..27
dcmgr/lib/dcmgr/endpoints/12.03/load_balancers.rb on lines 53..57
dcmgr/lib/dcmgr/endpoints/12.03/security_groups.rb on lines 39..44

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 25.

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 add(node_id)
      fields = {
        :node_id=>node_id,
      }.merge(map_options_to_column)
      fields.merge!({:uuid => options[:uuid]}) unless options[:uuid].nil?
Severity: Minor
Found in dcmgr/lib/dcmgr/cli/storage.rb and 1 other location - About 15 mins to fix
dcmgr/lib/dcmgr/cli/storage.rb on lines 90..96

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 25.

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 add(node_id)
      fields = {
        :node_id=>node_id,
      }.merge(map_options_to_column)
      fields.merge!({:uuid => options[:uuid]}) unless options[:uuid].nil?
Severity: Minor
Found in dcmgr/lib/dcmgr/cli/storage.rb and 1 other location - About 15 mins to fix
dcmgr/lib/dcmgr/cli/storage.rb on lines 41..47

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 25.

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 poweron(load_balancer_id)
        @collection ||= self.collection_name
        self.collection_name = File.join(@collection, load_balancer_id)
        result = self.put(:poweron, {:load_balancer_id => load_balancer_id})
        self.collection_name = @collection
client/ruby-hijiki/lib/hijiki/dcmgr_resource/12.03/load_balancer.rb on lines 67..72

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 25.

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 options[:ipv4_gw] && !@network_addr.include?(IPAddress::IPv4.new(options[:ipv4_gw]))
        Error.raise("ipv4_gw #{options[:ipv4_gw]} is out of range from network address: #{@network_addr}", 100)
      end
Severity: Minor
Found in dcmgr/lib/dcmgr/cli/network.rb and 1 other location - About 15 mins to fix
dcmgr/lib/dcmgr/cli/network.rb on lines 21..23

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 25.

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 options[:dhcp] && !@network_addr.include?(IPAddress::IPv4.new(options[:dhcp]))
        Error.raise("dhcp server address #{options[:dhcp]} is out of range from network address: #{@network_addr}", 100)
      end
Severity: Minor
Found in dcmgr/lib/dcmgr/cli/network.rb and 1 other location - About 15 mins to fix
dcmgr/lib/dcmgr/cli/network.rb on lines 17..19

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 25.

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 poweroff(load_balancer_id)
        @collection ||= self.collection_name
        self.collection_name = File.join(@collection, load_balancer_id)
        result = self.put(:poweroff, {:load_balancer_id => load_balancer_id})
        self.collection_name = @collection
client/ruby-hijiki/lib/hijiki/dcmgr_resource/12.03/load_balancer.rb on lines 59..64

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 25.

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