grommet/grommet-ferret

View on GitHub
src/js/components/dashboard/Dashboard.js

Summary

Maintainability
D
2 days
Test Coverage

Function render has 69 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  render () {
    const { dashboard, search } = this.props;

    let tasks;
    if (dashboard.tasks.count > 0) {
Severity: Major
Found in src/js/components/dashboard/Dashboard.js - About 2 hrs to fix

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

                <Tile pad="medium">
                  <Header size="small" justify="center">
                    <Heading tag="h3">Memory</Heading>
                  </Header>
                  <AnnotatedMeter type="circle" legend={true} units="GB"
    Severity: Major
    Found in src/js/components/dashboard/Dashboard.js and 2 other locations - About 3 hrs to fix
    src/js/components/dashboard/Dashboard.js on lines 174..180
    src/js/components/dashboard/Dashboard.js on lines 188..194

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

    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

                <Tile pad="medium">
                  <Header size="small" justify="center">
                    <Heading tag="h3">CPU</Heading>
                  </Header>
                  <AnnotatedMeter type="circle" legend={true} units="GHz"
    Severity: Major
    Found in src/js/components/dashboard/Dashboard.js and 2 other locations - About 3 hrs to fix
    src/js/components/dashboard/Dashboard.js on lines 181..187
    src/js/components/dashboard/Dashboard.js on lines 188..194

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

    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

                <Tile pad="medium">
                  <Header size="small" justify="center">
                    <Heading tag="h3">Storage</Heading>
                  </Header>
                  <AnnotatedMeter type="circle" legend={true} units="TB"
    Severity: Major
    Found in src/js/components/dashboard/Dashboard.js and 2 other locations - About 3 hrs to fix
    src/js/components/dashboard/Dashboard.js on lines 174..180
    src/js/components/dashboard/Dashboard.js on lines 181..187

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

    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

        let storageData = [
          {value: 427, label: 'In use', colorIndex: 'accent-1',
            onClick: this._onClickUtilization.bind(this, 'diskUsed')},
          {value: 573, label: 'Available', colorIndex: 'unset'}
        ];
    Severity: Major
    Found in src/js/components/dashboard/Dashboard.js and 2 other locations - About 1 hr to fix
    src/js/components/dashboard/Dashboard.js on lines 138..142
    src/js/components/dashboard/Dashboard.js on lines 144..148

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

    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

        let cpuData = [
          {value: 58, label: 'In use', colorIndex: 'accent-1',
            onClick: this._onClickUtilization.bind(this, 'memoryUsed')},
          {value: 42, label: 'Available', colorIndex: 'unset'}
        ];
    Severity: Major
    Found in src/js/components/dashboard/Dashboard.js and 2 other locations - About 1 hr to fix
    src/js/components/dashboard/Dashboard.js on lines 144..148
    src/js/components/dashboard/Dashboard.js on lines 150..154

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

    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

        let memoryData = [
          {value: 127, label: 'In use', colorIndex: 'accent-1',
            onClick: this._onClickUtilization.bind(this, 'memoryUsed')},
          {value: 73, label: 'Available', colorIndex: 'unset'}
        ];
    Severity: Major
    Found in src/js/components/dashboard/Dashboard.js and 2 other locations - About 1 hr to fix
    src/js/components/dashboard/Dashboard.js on lines 138..142
    src/js/components/dashboard/Dashboard.js on lines 150..154

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

    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

        const suggestions = nextProps.search.suggestions.map((suggestion) => {
          return {
            suggestion: suggestion,
            label: (
              <Suggestion name={suggestion.name} category={suggestion.category} />
    Severity: Minor
    Found in src/js/components/dashboard/Dashboard.js and 1 other location - About 45 mins to fix
    src/js/components/virtualMachine/VirtualMachineEditNetwork.js on lines 36..41

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

    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

    There are no issues that match your filters.

    Category
    Status