theforeman/foreman_fog_proxmox

View on GitHub

Showing 185 of 185 total issues

Function ProxmoxServerNetwork has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

const ProxmoxServerNetwork = ({ network, bridges, paramScope }) => {
  const [interfaces, setInterfaces] = useState([]);
  const [nextId, setNextId] = useState(0);
  const [availableIds, setAvailableIds] = useState([]);
  const [usedIds, setUsedIds] = useState(new Set());
Severity: Minor
Found in webpack/components/ProxmoxServer/ProxmoxServerNetwork.js - About 45 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method additional_attrs has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

  def additional_attrs(vms, param_scope, start_checked)
    attributes = {
      pool: vms.pool,
      image_id: vms.image_id,
      cpu_type: vms.config.cpu_type,
Severity: Minor
Found in app/helpers/proxmox_vm_attrs_helper.rb - About 45 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method save_vm has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    def save_vm(uuid, new_attributes)
      vm = find_vm_by_uuid(uuid)
      templated = new_attributes['templated']
      node_id = new_attributes['node_id']
      if templated == '1' && !vm.templated?
Severity: Minor
Found in app/models/foreman_fog_proxmox/proxmox_vm_commands.rb - About 45 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

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

    def network_client
      @network_client ||= ::Fog::Proxmox::Network.new(fog_credentials)
    rescue Excon::Errors::Unauthorized => e
      raise ::Foreman::Exception, 'User token expired' if token_expired?(e)
    rescue StandardError => e
Severity: Major
Found in app/models/foreman_fog_proxmox/proxmox.rb and 2 other locations - About 45 mins to fix
app/models/foreman_fog_proxmox/proxmox.rb on lines 151..158
app/models/foreman_fog_proxmox/proxmox.rb on lines 160..167

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 3 locations. Consider refactoring.
Open

    def identity_client
      @identity_client ||= ::Fog::Proxmox::Identity.new(fog_credentials)
    rescue Excon::Errors::Unauthorized => e
      raise ::Foreman::Exception, 'User token expired' if token_expired?(e)
    rescue StandardError => e
Severity: Major
Found in app/models/foreman_fog_proxmox/proxmox.rb and 2 other locations - About 45 mins to fix
app/models/foreman_fog_proxmox/proxmox.rb on lines 151..158
app/models/foreman_fog_proxmox/proxmox.rb on lines 169..176

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 3 locations. Consider refactoring.
Open

    def client
      @client ||= ::Fog::Proxmox::Compute.new(fog_credentials)
    rescue Excon::Errors::Unauthorized => e
      raise ::Foreman::Exception, 'User token expired' if token_expired?(e)
    rescue StandardError => e
Severity: Major
Found in app/models/foreman_fog_proxmox/proxmox.rb and 2 other locations - About 45 mins to fix
app/models/foreman_fog_proxmox/proxmox.rb on lines 160..167
app/models/foreman_fog_proxmox/proxmox.rb on lines 169..176

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 4 locations. Consider refactoring.
Open

      def >(other)
        raise TypeError unless other.is_a?(SemverClass)

        result = @major > other.major
        result = @minor > other.minor if @major == other.major
Severity: Major
Found in lib/foreman_fog_proxmox/semver.rb and 3 other locations - About 45 mins to fix
lib/foreman_fog_proxmox/semver.rb on lines 39..45
lib/foreman_fog_proxmox/semver.rb on lines 48..54
lib/foreman_fog_proxmox/semver.rb on lines 66..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 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 4 locations. Consider refactoring.
Open

      def <=(other)
        raise TypeError unless other.is_a?(SemverClass)

        result = @major <= other.major
        result = @minor <= other.minor if @major == other.major
Severity: Major
Found in lib/foreman_fog_proxmox/semver.rb and 3 other locations - About 45 mins to fix
lib/foreman_fog_proxmox/semver.rb on lines 48..54
lib/foreman_fog_proxmox/semver.rb on lines 57..63
lib/foreman_fog_proxmox/semver.rb on lines 66..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 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 4 locations. Consider refactoring.
Open

      def <(other)
        raise TypeError unless other.is_a?(SemverClass)

        result = @major < other.major
        result = @minor < other.minor if @major == other.major
Severity: Major
Found in lib/foreman_fog_proxmox/semver.rb and 3 other locations - About 45 mins to fix
lib/foreman_fog_proxmox/semver.rb on lines 39..45
lib/foreman_fog_proxmox/semver.rb on lines 57..63
lib/foreman_fog_proxmox/semver.rb on lines 66..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 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 4 locations. Consider refactoring.
Open

      def >=(other)
        raise TypeError unless other.is_a?(SemverClass)

        result = @major >= other.major
        result = @minor >= other.minor if @major == other.major
Severity: Major
Found in lib/foreman_fog_proxmox/semver.rb and 3 other locations - About 45 mins to fix
lib/foreman_fog_proxmox/semver.rb on lines 39..45
lib/foreman_fog_proxmox/semver.rb on lines 48..54
lib/foreman_fog_proxmox/semver.rb on lines 57..63

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 5 locations. Consider refactoring.
Open

      <input
        name={hdd?.id?.name}
        type="hidden"
        value={hdd?.id?.value}
        onChange={handleChange}
Severity: Major
Found in webpack/components/ProxmoxServer/components/HardDisk.js and 4 other locations - About 40 mins to fix
webpack/components/ProxmoxContainer/MountPoint.js on lines 61..66
webpack/components/ProxmoxContainer/MountPoint.js on lines 67..72
webpack/components/ProxmoxServer/components/HardDisk.js on lines 70..75
webpack/components/ProxmoxServer/components/HardDisk.js on lines 82..87

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

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 5 locations. Consider refactoring.
Open

      <input
        name={mp?.volid?.name}
        type="hidden"
        value={mp?.volid?.value}
        onChange={handleChange}
Severity: Major
Found in webpack/components/ProxmoxContainer/MountPoint.js and 4 other locations - About 40 mins to fix
webpack/components/ProxmoxContainer/MountPoint.js on lines 61..66
webpack/components/ProxmoxServer/components/HardDisk.js on lines 70..75
webpack/components/ProxmoxServer/components/HardDisk.js on lines 76..81
webpack/components/ProxmoxServer/components/HardDisk.js on lines 82..87

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

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 5 locations. Consider refactoring.
Open

      <input
        name={mp?.id?.name}
        type="hidden"
        value={mp?.id?.value}
        onChange={handleChange}
Severity: Major
Found in webpack/components/ProxmoxContainer/MountPoint.js and 4 other locations - About 40 mins to fix
webpack/components/ProxmoxContainer/MountPoint.js on lines 67..72
webpack/components/ProxmoxServer/components/HardDisk.js on lines 70..75
webpack/components/ProxmoxServer/components/HardDisk.js on lines 76..81
webpack/components/ProxmoxServer/components/HardDisk.js on lines 82..87

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

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 5 locations. Consider refactoring.
Open

      <input
        name={hdd?.volid?.name}
        type="hidden"
        value={hdd?.volid?.value}
        onChange={handleChange}
Severity: Major
Found in webpack/components/ProxmoxServer/components/HardDisk.js and 4 other locations - About 40 mins to fix
webpack/components/ProxmoxContainer/MountPoint.js on lines 61..66
webpack/components/ProxmoxContainer/MountPoint.js on lines 67..72
webpack/components/ProxmoxServer/components/HardDisk.js on lines 70..75
webpack/components/ProxmoxServer/components/HardDisk.js on lines 76..81

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

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 5 locations. Consider refactoring.
Open

      <input
        name={hdd?.storageType?.name}
        type="hidden"
        value={hdd?.storageType?.value}
        onChange={handleChange}
Severity: Major
Found in webpack/components/ProxmoxServer/components/HardDisk.js and 4 other locations - About 40 mins to fix
webpack/components/ProxmoxContainer/MountPoint.js on lines 61..66
webpack/components/ProxmoxContainer/MountPoint.js on lines 67..72
webpack/components/ProxmoxServer/components/HardDisk.js on lines 76..81
webpack/components/ProxmoxServer/components/HardDisk.js on lines 82..87

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

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

ProxmoxServerStorage.propTypes = {
  storage: PropTypes.object,
  storages: PropTypes.array,
  paramScope: PropTypes.string,
  nodeId: PropTypes.string,
Severity: Minor
Found in webpack/components/ProxmoxServer/ProxmoxServerStorage.js and 1 other location - About 40 mins to fix
webpack/components/ProxmoxContainer/ProxmoxContainerStorage.js on lines 180..185

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

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

ProxmoxContainerStorage.propTypes = {
  storage: PropTypes.object,
  storages: PropTypes.array,
  nodeId: PropTypes.string,
  paramScope: PropTypes.string,
Severity: Minor
Found in webpack/components/ProxmoxContainer/ProxmoxContainerStorage.js and 1 other location - About 40 mins to fix
webpack/components/ProxmoxServer/ProxmoxServerStorage.js on lines 258..263

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

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

Method add_and_format_element has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def self.add_and_format_element(dest, dest_key, origin, origin_key, format = :to_s)
Severity: Minor
Found in lib/foreman_fog_proxmox/hash_collection.rb - About 35 mins to fix

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

        case 'lxc':
          updateOptions('ostemplates', 'compute_attributes_ostemplate', 'storage', 'compute_attributes_ostemplate', 'file', 'storage', node_id, undefined);
          updateOptions('storages', 'compute_attributes_volumes_attributes', 'storage', undefined, undefined, 'storage', node_id, undefined);
          updateOptions('bridges', 'interfaces_attributes', 'compute_attributes_bridge', undefined, undefined, 'iface', node_id, undefined);
          break;
    Severity: Minor
    Found in app/assets/javascripts/foreman_fog_proxmox/proxmox_vm.js and 1 other location - About 35 mins to fix
    app/assets/javascripts/foreman_fog_proxmox/proxmox_vm.js on lines 223..227

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

    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 'qemu':
          updateOptions('isostorages', 'compute_attributes_config_attributes', 'cdrom_storage', 'compute_attributes_config_attributes', 'cdrom_iso', 'storage', node_id, undefined);
          updateOptions('storages', 'compute_attributes_volumes_attributes', 'storage', undefined, undefined, 'storage', node_id, undefined);
          updateOptions('bridges', 'interfaces_attributes', 'compute_attributes_bridge', undefined, undefined, 'iface', node_id, undefined);
          break;
    Severity: Minor
    Found in app/assets/javascripts/foreman_fog_proxmox/proxmox_vm.js and 1 other location - About 35 mins to fix
    app/assets/javascripts/foreman_fog_proxmox/proxmox_vm.js on lines 228..232

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

    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