ManageIQ/manageiq-ui-classic

View on GitHub
app/javascript/components/provider-dashboard-charts/pod-trend-charts/podsAreaChart.js

Summary

Maintainability
A
2 hrs
Test Coverage

Unexpected usage of singlequote.
Open

    <div className='pods_area_chart_section'>

enforce the consistent use of either double or single quotes in JSX attributes (jsx-quotes)

JSX attribute values can contain string literals, which are delimited with single or double quotes.


Unlike string literals in JavaScript, string literals within JSX attributes can’t contain escaped quotes. If you want to have e.g. a double quote within a JSX attribute value, you have to use single quotes as string delimiter.


Rule Details

This rule enforces the consistent use of either double or single quotes in JSX attributes.

Options

This rule has a string option:

  • "prefer-double" (default) enforces the use of double quotes for all JSX attribute values that don't contain a double quote.
  • "prefer-single" enforces the use of single quotes for all JSX attribute values that don’t contain a single quote.

prefer-double

Examples of incorrect code for this rule with the default "prefer-double" option:

/*eslint jsx-quotes: ["error", "prefer-double"]*/

Examples of correct code for this rule with the default "prefer-double" option:

/*eslint jsx-quotes: ["error", "prefer-double"]*/


prefer-single

Examples of incorrect code for this rule with the "prefer-single" option:

/*eslint jsx-quotes: ["error", "prefer-single"]*/

Examples of correct code for this rule with the "prefer-single" option:

/*eslint jsx-quotes: ["error", "prefer-single"]*/


When Not To Use It

You can turn this rule off if you don’t use JSX or if you aren’t concerned with a consistent usage of quotes within JSX attributes.

Related Rules

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

      { (config.valueType === 'actual') && (
        <span>
          <span className="trend-title-big-pf">
            {' '}
            {getLatestValue(usageData.xy_data)}
app/javascript/components/provider-dashboard-charts/usage-network-image-charts/usageAreaChart.js on lines 54..66

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

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

'config.headTitle' is missing in props validation
Open

    title: config.headTitle,

For more information visit Source: http://eslint.org/docs/rules/

There are no issues that match your filters.

Category
Status