ManageIQ/manageiq-ui-classic

View on GitHub

Showing 18,390 of 18,390 total issues

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

        {
            "href": "http://localhost:3001/api/configuration_script_sources/18/configuration_script_payloads/215",
            "id": "215",
            "manager_id": "2",
            "manager_ref": "widgets/30_Top_CPU_Consumers_(last_hour).yaml",
Severity: Major
Found in app/javascript/spec/ansible-edit-catalog-form/mockdata.js and 68 other locations - About 1 hr to fix
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5009..5024
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5025..5040
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5041..5056
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5057..5072
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5073..5088
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5089..5104
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5105..5120
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5121..5136
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5137..5152
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5153..5168
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5169..5184
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5185..5200
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5201..5216
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5217..5232
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5233..5248
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5249..5264
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5265..5280
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5281..5296
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5297..5312
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5313..5328
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5329..5344
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5345..5360
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5361..5376
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5377..5392
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5393..5408
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5409..5424
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5425..5440
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5441..5456
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5457..5472
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5473..5488
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5489..5504
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5505..5520
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5521..5536
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5537..5552
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5553..5568
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5569..5584
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5585..5600
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5601..5616
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5617..5632
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5633..5648
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5649..5664
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5665..5680
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5681..5696
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5697..5712
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5713..5728
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5729..5744
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5745..5760
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5777..5792
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5793..5808
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5809..5824
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5825..5840
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5841..5856
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5857..5872
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5873..5888
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5889..5904
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5905..5920
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5921..5936
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5937..5952
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5953..5968
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5969..5984
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5985..6000
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 6001..6016
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 6017..6032
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 6033..6048
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 6049..6064
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 6065..6080
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 6081..6096
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 6097..6112

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

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

        {
            "href": "http://localhost:3001/api/configuration_script_sources/18/configuration_script_payloads/234",
            "id": "234",
            "manager_id": "2",
            "manager_ref": "widgets/936_Azure_-_Active_VMs.yaml",
Severity: Major
Found in app/javascript/spec/ansible-edit-catalog-form/mockdata.js and 68 other locations - About 1 hr to fix
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5009..5024
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5025..5040
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5041..5056
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5057..5072
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5073..5088
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5089..5104
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5105..5120
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5121..5136
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5137..5152
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5153..5168
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5169..5184
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5185..5200
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5201..5216
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5217..5232
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5233..5248
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5249..5264
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5265..5280
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5281..5296
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5297..5312
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5313..5328
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5329..5344
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5345..5360
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5361..5376
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5377..5392
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5393..5408
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5409..5424
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5425..5440
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5441..5456
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5457..5472
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5473..5488
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5489..5504
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5505..5520
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5521..5536
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5537..5552
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5553..5568
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5569..5584
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5585..5600
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5601..5616
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5617..5632
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5633..5648
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5649..5664
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5665..5680
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5681..5696
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5697..5712
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5713..5728
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5729..5744
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5745..5760
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5761..5776
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5777..5792
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5793..5808
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5809..5824
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5825..5840
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5841..5856
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5857..5872
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5873..5888
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5889..5904
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5905..5920
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5921..5936
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5937..5952
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5953..5968
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5969..5984
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 5985..6000
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 6001..6016
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 6017..6032
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 6033..6048
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 6049..6064
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 6081..6096
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 6097..6112

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

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

      <div className="card-wrapper" id="services">
        <PfAggregateStatusCard
          showTopBorder
          altLayout={false}
          layout="mini"
Severity: Major
Found in app/javascript/components/container-projects/helper.jsx and 2 other locations - About 1 hr to fix
app/javascript/components/container-projects/helper.jsx on lines 62..73
app/javascript/components/container-projects/helper.jsx on lines 74..85

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

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

export const reportListData = (nodes, reportMenu, reportTitle, reportDetails) => {
  switch (nodes.length) {
    case 1:
      return levelOne(reportMenu, reportTitle);
    case 2:
Severity: Major
Found in app/javascript/components/data-tables/reports/helper.js and 1 other location - About 1 hr to fix
app/javascript/components/data-tables/report-list/helper.js on lines 109..119

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

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

      var allSecondHalfPMHoursUnchecked = function(i) {
        var hourSecondHalfPMValues = _.times(6, _.constant(false));
        hourSecondHalfPMValues[i] = true;
        return angular.equals(scope.vm.timeProfileModel.hourValuesPMSecondHalf, hourSecondHalfPMValues);
      };
app/javascript/oldjs/directives/configuration/min_time_check.js on lines 33..37
app/javascript/oldjs/directives/configuration/min_time_check.js on lines 46..50
app/javascript/oldjs/directives/configuration/min_time_check.js on lines 52..56
app/javascript/oldjs/directives/configuration/min_time_check.js on lines 58..62

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

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

      const headers = [
        { key: 'name', header: __('Name') },
        { key: 'phase', header: __('Status') },
        { key: 'ready_condition_status', header: __('Ready Status') },
        { key: 'running_containers_summary', header: __('Ready Containers') },
Severity: Major
Found in app/javascript/components/container-projects/helper.jsx and 2 other locations - About 1 hr to fix
app/javascript/components/reconfigure-vm-form/helpers/disk.js on lines 256..261
app/javascript/spec/reconfigure-vm-form/datatable-data.js on lines 1..6

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

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

export const reportListData = (nodes, reportMenu, reportTitle, reportDetails) => {
  switch (nodes.length) {
    case 1:
      return levelOne(reportMenu, reportTitle);
    case 2:
Severity: Major
Found in app/javascript/components/data-tables/report-list/helper.js and 1 other location - About 1 hr to fix
app/javascript/components/data-tables/reports/helper.js on lines 99..109

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

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

      <div className="card-wrapper" id="containers">
        <PfAggregateStatusCard
          showTopBorder
          altLayout={false}
          layout="mini"
Severity: Major
Found in app/javascript/components/container-projects/helper.jsx and 2 other locations - About 1 hr to fix
app/javascript/components/container-projects/helper.jsx on lines 74..85
app/javascript/components/container-projects/helper.jsx on lines 86..97

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

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

      <div className="card-wrapper" id="images">
        <PfAggregateStatusCard
          showTopBorder
          altLayout={false}
          layout="mini"
Severity: Major
Found in app/javascript/components/container-projects/helper.jsx and 2 other locations - About 1 hr to fix
app/javascript/components/container-projects/helper.jsx on lines 62..73
app/javascript/components/container-projects/helper.jsx on lines 86..97

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

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

export const driveHeaders = [
  { key: 'name', header: __('Name') },
  { key: 'hostFile', header: __('Host File') },
  { key: 'disconnect', header: __('Disconnect') },
  { key: 'action', header: __('Actions') },
Severity: Major
Found in app/javascript/spec/reconfigure-vm-form/datatable-data.js and 2 other locations - About 1 hr to fix
app/javascript/components/container-projects/helper.jsx on lines 414..419
app/javascript/components/reconfigure-vm-form/helpers/disk.js on lines 256..261

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

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

        headers={[
          { key: 'Enforced', header: __('Enforced') },
          { key: 'Description', header: __('Description') },
          { key: 'Value', header: __('Value') },
          { key: 'Units', header: __('Units') },
Severity: Major
Found in app/javascript/components/tenant-quota-form/index.jsx and 1 other location - About 1 hr to fix
app/javascript/components/workflow-credential-mapping-form/helper.js on lines 12..17

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

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

  const headers = [
    { key: 'name', header: __('Name') },
    { key: 'type', header: __('Type') },
    { key: 'size', header: __('Size') },
    { key: 'unit', header: __('Unit') },
app/javascript/components/container-projects/helper.jsx on lines 414..419
app/javascript/spec/reconfigure-vm-form/datatable-data.js on lines 1..6

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

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

        headers={[
          { key: 'CredentialsIdentifier', header: __('Credentials Identifier') },
          { key: 'CredentialRecord', header: __('Credential Record') },
          { key: 'CredentialField', header: __('Credential Field') },
          { key: 'Delete', header: __('Delete') },
app/javascript/components/tenant-quota-form/index.jsx on lines 70..75

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

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 calculate_rp_config has 46 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def calculate_rp_config(db_record)
    rp_config = []
    unless db_record.memory_reserve.nil?
      rp_config.push(:field       => _("Memory Reserve"),
                     :description => db_record.memory_reserve)
Severity: Minor
Found in app/helpers/resource_pool_helper.rb - About 1 hr to fix

Method prov_req_submit has 46 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def prov_req_submit
    id = session[:edit][:req_id] || "new"
    return unless load_edit("prov_edit__#{id}", "show_list")

    @edit[:new][:schedule_time] = @edit[:new][:schedule_time].in_time_zone("Etc/UTC") if @edit[:new][:schedule_time]
Severity: Minor
Found in app/controllers/application_controller/miq_request_methods.rb - About 1 hr to fix

Method automate_button_field_changed has 46 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def automate_button_field_changed
    assert_privileges(feature_by_action)

    unless params[:target_class]
      @edit = session[:edit]
Severity: Minor
Found in app/controllers/application_controller/buttons.rb - About 1 hr to fix

Method custom_buttons has 46 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def custom_buttons(ids = nil, display_options = {})
    button = CustomButton.find(params[:button_id])
    cls = custom_button_class_model(button.applies_to_class)
    @explorer = true if BASE_MODEL_EXPLORER_CLASSES.include?(cls)
    ids ||= params[:id] unless relationship_table_screen? && @record.nil?
Severity: Minor
Found in app/controllers/application_controller/buttons.rb - About 1 hr to fix

Method button has 46 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def button
    @edit = session[:edit]                                  # Restore @edit for adv search box
    params[:page] = @current_page unless @current_page.nil? # Save current page for list refresh
    @refresh_div = "main_div"                               # Default div for button.rjs to refresh

Severity: Minor
Found in app/controllers/vm_common.rb - About 1 hr to fix

Method method_form_fields has 46 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def method_form_fields
    assert_privileges("miq_ae_method_edit")

    if params[:id] == 'new'
      method = MiqAeMethod.new
Severity: Minor
Found in app/controllers/miq_ae_class_controller.rb - About 1 hr to fix

Method ap_get_form_vars_registry has 46 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def ap_get_form_vars_registry
    unless params[:entry]['kname'].present? && params[:entry]['value'].present?
      session[:reg_data] = {
        :key   => params[:entry]['kname'],
        :value => params[:entry]['value'],
Severity: Minor
Found in app/controllers/ops_controller/settings/analysis_profiles.rb - About 1 hr to fix
Severity
Category
Status
Source
Language