ManageIQ/manageiq-ui-classic

View on GitHub

Showing 18,390 of 18,390 total issues

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

  {
    topLeft: {
      text: '999',
      tooltip: 'Hello, I am a very useful tooltip in the first quadrant!',
    },
Severity: Major
Found in app/javascript/spec/quadicon/data/quadicons.js and 5 other locations - About 2 hrs to fix
app/javascript/spec/quadicon/data/quadicons.js on lines 175..196
app/javascript/spec/quadicon/data/quadicons.js on lines 219..240
app/javascript/spec/quadicon/data/quadicons.js on lines 241..262
app/javascript/spec/quadicon/data/quadicons.js on lines 323..344
app/javascript/spec/quadicon/data/quadicons.js on lines 345..366

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

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

                                    {
                                        "key": "tn-9",
                                        "text": "testtel",
                                        "icon": "pficon pficon-tenant",
                                        "selectable": true,
Severity: Major
Found in app/javascript/spec/ansible-edit-catalog-form/mockdata.js and 1 other location - About 2 hrs to fix
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 1093..1114

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

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

                            {
                                "key": "tn-14",
                                "text": "kmtest1",
                                "icon": "pficon pficon-tenant",
                                "selectable": true,
Severity: Major
Found in app/javascript/spec/ansible-edit-catalog-form/mockdata.js and 1 other location - About 2 hrs to fix
app/javascript/spec/ansible-edit-catalog-form/mockdata.js on lines 1251..1272

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

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

File miq-component.spec.js has 414 lines of code (exceeds 400 allowed). Consider refactoring.
Open

import {
  getDefinition,
  sanitizeAndFreezeInstanceId,
  validateInstance,
  define,
Severity: Minor
Found in app/javascript/spec/miq-component/miq-component.spec.js - About 2 hrs to fix

Class MiqActionController has 22 methods (exceeds 20 allowed). Consider refactoring.
Open

class MiqActionController < ApplicationController
  before_action :check_privileges
  before_action :get_session_data
  after_action :cleanup_action
  after_action :set_session_data
Severity: Minor
Found in app/controllers/miq_action_controller.rb - About 2 hrs to fix

Class AnsibleRepositoryController has 22 methods (exceeds 20 allowed). Consider refactoring.
Open

class AnsibleRepositoryController < ApplicationController
  before_action :check_privileges
  before_action :get_session_data

  after_action :cleanup_action
Severity: Minor
Found in app/controllers/ansible_repository_controller.rb - About 2 hrs to fix

Method display_methods has 58 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      def display_methods
        %w[
          availability_zones
          cloud_databases
          cloud_networks
Severity: Major
Found in app/controllers/mixins/ems_common.rb - About 2 hrs to fix

Method authenticate has 58 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def authenticate
    @layout = "dashboard"

    unless params[:task_id] # First time thru, check for buttons pressed
      # Handle More and Back buttons (for changing password)
Severity: Major
Found in app/controllers/dashboard_controller.rb - About 2 hrs to fix

Method miq_report_edit has 58 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def miq_report_edit
    assert_privileges(params[:id] || (@edit && @edit[:rpt_id]) ? "miq_report_edit" : "miq_report_new")
    case params[:button]
    when "cancel"
      if @edit[:rpt_id]
Severity: Major
Found in app/controllers/report_controller/reports/editor.rb - About 2 hrs to fix

Method schedule_edit has 58 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def schedule_edit
    assert_privileges("miq_report_schedule_edit")
    case params[:button]
    when "cancel"
      @schedule = MiqSchedule.find(session[:edit][:sched_id]) if session[:edit] && session[:edit][:sched_id]
Severity: Major
Found in app/controllers/report_controller/schedules.rb - About 2 hrs to fix

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

  useEffect(() => {
    const url = `/${apiUrl}/${providerId}`;
    http.get(url)
      .then((response) => {
        setCardData({
app/javascript/components/provider-dashboard-charts/pod-trend-charts/index.js on lines 12..21
app/javascript/components/provider-dashboard-charts/recent-vm-chart/index.js on lines 12..21
app/javascript/components/refresh-data-notification.jsx on lines 11..20

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

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

  it('should render condition notes structured list', () => {
    const wrapper = shallow(<MiqStructuredList
      rows={conditionNotes.items}
      title={conditionNotes.title}
      mode={conditionNotes.mode}
Severity: Major
Found in app/javascript/spec/miq-condition/miq-condition-spec.js and 4 other locations - About 2 hrs to fix
app/javascript/spec/miq-condition/miq-condition-spec.js on lines 10..17
app/javascript/spec/miq-condition/miq-condition-spec.js on lines 19..26
app/javascript/spec/miq-condition/miq-condition-spec.js on lines 28..35
app/javascript/spec/miq-condition/miq-condition-spec.js on lines 37..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 81.

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

  if (!Object.prototype.hasOwnProperty.call(requestObject, 'price')) {
    requestObject.price = '';
  } else {
    requestObject.price = requestObject.price != null ? requestObject.price.toString() : '';
  }
app/javascript/components/ansible-playbook-edit-catalog-form/helper.js on lines 219..223

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

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

  it('should render condition expression structured list', () => {
    const wrapper = shallow(<MiqStructuredList
      rows={conditionsExpressionData.items}
      title={conditionsExpressionData.title}
      mode={conditionsExpressionData.mode}
Severity: Major
Found in app/javascript/spec/miq-condition/miq-condition-spec.js and 4 other locations - About 2 hrs to fix
app/javascript/spec/miq-condition/miq-condition-spec.js on lines 10..17
app/javascript/spec/miq-condition/miq-condition-spec.js on lines 19..26
app/javascript/spec/miq-condition/miq-condition-spec.js on lines 37..44
app/javascript/spec/miq-condition/miq-condition-spec.js on lines 46..53

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

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

  it('should render condition scope structured list', () => {
    const wrapper = shallow(<MiqStructuredList
      rows={conditionsScopeData.items}
      title={conditionsScopeData.title}
      mode={conditionsScopeData.mode}
Severity: Major
Found in app/javascript/spec/miq-condition/miq-condition-spec.js and 4 other locations - About 2 hrs to fix
app/javascript/spec/miq-condition/miq-condition-spec.js on lines 10..17
app/javascript/spec/miq-condition/miq-condition-spec.js on lines 28..35
app/javascript/spec/miq-condition/miq-condition-spec.js on lines 37..44
app/javascript/spec/miq-condition/miq-condition-spec.js on lines 46..53

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

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

    StackedArea: _.defaultsDeep(
      {
        axis: { x: { type: 'category' } },
        data: { type: 'area' },
        legend: { show: true, position: 'right' },
Severity: Major
Found in app/javascript/oldjs/miq_c3_config.js and 3 other locations - About 2 hrs to fix
app/javascript/oldjs/miq_c3_config.js on lines 134..141
app/javascript/oldjs/miq_c3_config.js on lines 161..168
app/javascript/oldjs/miq_c3_config.js 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 81.

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

    Line: _.defaultsDeep(
      {
        axis: { x: { type: 'category' } },
        data: { type: 'line' },
        legend: { show: true, position: 'right' },
Severity: Major
Found in app/javascript/oldjs/miq_c3_config.js and 3 other locations - About 2 hrs to fix
app/javascript/oldjs/miq_c3_config.js on lines 134..141
app/javascript/oldjs/miq_c3_config.js on lines 169..176
app/javascript/oldjs/miq_c3_config.js on lines 177..184

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

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

    Area: _.defaultsDeep(
      {
        axis: { x: { type: 'category' } },
        data: { type: 'area' },
        legend: { show: true, position: 'right' },
Severity: Major
Found in app/javascript/oldjs/miq_c3_config.js and 3 other locations - About 2 hrs to fix
app/javascript/oldjs/miq_c3_config.js on lines 134..141
app/javascript/oldjs/miq_c3_config.js on lines 161..168
app/javascript/oldjs/miq_c3_config.js on lines 177..184

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

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

  useEffect(() => {
    if (recordId) {
      API.get(`/api/host_aggregates/${recordId}`).then((initialValues) => {
        setState((state) => ({ ...state, initialValues, isLoading: false }));
      });
Severity: Major
Found in app/javascript/components/host-aggregate-form/index.jsx and 2 other locations - About 2 hrs to fix
app/javascript/components/cloud-tenant-form/index.jsx on lines 11..17
app/javascript/components/vm-common-rename-form/index.jsx on lines 14..20

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

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

  if (!Object.prototype.hasOwnProperty.call(requestObject, 'price')) {
    requestObject.price = '';
  } else {
    requestObject.price = requestObject.price != null ? requestObject.price.toString() : '';
  }
app/javascript/components/terraform-template-catalog-form/helper.js on lines 220..224

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

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