grommet/grommet-ferret

View on GitHub

Showing 386 of 386 total issues

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

            <Tile pad="medium">
              <Header size="small" justify="center">
                <Heading tag="h3">Storage</Heading>
              </Header>
              <AnnotatedMeter type="circle" legend={true} units="GB"
Severity: Major
Found in src/js/components/virtualMachine/VirtualMachineMetrics.js and 1 other location - About 3 hrs to fix
src/js/components/virtualMachine/VirtualMachineMetrics.js on lines 166..172

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

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

        <FormField label="Memory (GB)" htmlFor="memory" error={errors.memory}>
          <NumberInput id="memory" name="size.memory" min={1} max={1024}
            value={size.memory || 0}
            onChange={this._change('size', 'memory')} />
        </FormField>
Severity: Major
Found in src/js/components/virtualMachine/VirtualMachineEdit.js and 1 other location - About 3 hrs to fix
src/js/components/virtualMachine/VirtualMachineEdit.js on lines 191..195

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

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

        <FormField label="vCPUs" htmlFor="vCpus" error={errors.vCpus}>
          <NumberInput id="vCpus" name="size.vCpus" min={1} max={128}
            value={size.vCpus || 0}
            onChange={this._change('size', 'vCpus')} />
        </FormField>
Severity: Major
Found in src/js/components/virtualMachine/VirtualMachineEdit.js and 1 other location - About 3 hrs to fix
src/js/components/virtualMachine/VirtualMachineEdit.js on lines 196..200

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

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

              <FormField label="vCPUs" htmlFor="vCpus"
                error={errors.vCpus}>
                <NumberInput id="vCpus" name="vCpus" min={1} max={128}
                  value={size.vCpus || 0} onChange={this._change('vCpus')} />
              </FormField>
Severity: Major
Found in src/js/components/size/SizeForm.js and 1 other location - About 3 hrs to fix
src/js/components/size/SizeForm.js on lines 128..132

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

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

              <FormField label="Memory (GB)" htmlFor="memory"
                error={errors.memory}>
                <NumberInput id="memory" name="memory" min={1} max={1024}
                  value={size.memory || 0} onChange={this._change('memory')} />
              </FormField>
Severity: Major
Found in src/js/components/size/SizeForm.js and 1 other location - About 3 hrs to fix
src/js/components/size/SizeForm.js on lines 123..127

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

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

Function start has 73 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function start () {
  const app = express();

  app.use(ddos.express);

Severity: Major
Found in server/server.js - About 2 hrs to fix

    Function _renderNameFields has 73 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      _renderNameFields () {
        const { count, naming, template, errors } = this.state;
        let nameFields;
        if (1 === count) {
    
    
    Severity: Major
    Found in src/js/components/virtualMachine/VirtualMachineAdd.js - About 2 hrs to fix

      Function alphanum has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
      Open

      function alphanum (a, b) {
        function chunkify(t) {
          var tz = [],
            x = 0,
            y = -1,
      Severity: Minor
      Found in server/filter.js - About 2 hrs 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

      Function timer has 72 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          let timer = setInterval(() => {
            index += 1;
            if (index < 10) {
              setStatus({state: 'updating',
                percent: Math.floor((index / 10) * 100)});
      Severity: Major
      Found in server/rest.js - About 2 hrs to fix

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

          [IMAGE_LOAD_OS_TYPES_SUCCESS]: (state, action) => {
            // trim properties
            let osTypes = action.result.items.map((i) => {
              return {name: i.name, uri: i.uri, label: i.name, value: i.uri};
            });
        Severity: Major
        Found in src/js/reducers/image.js and 1 other location - About 2 hrs to fix
        src/js/reducers/vm.js on lines 22..28

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

        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

          [VM_LOAD_IMAGES_SUCCESS]: (state, action) => {
            // trim properties
            let images = action.result.items.map((i) => {
              return {name: i.name, uri: i.uri, label: i.name, value: i.uri};
            });
        Severity: Major
        Found in src/js/reducers/vm.js and 1 other location - About 2 hrs to fix
        src/js/reducers/image.js on lines 56..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 92.

        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

        VirtualMachineAdd has 25 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class VirtualMachineAdd extends Component {
        
          constructor (props) {
            super(props);
            this._onSubmit = this._onSubmit.bind(this);
        Severity: Minor
        Found in src/js/components/virtualMachine/VirtualMachineAdd.js - About 2 hrs to fix

          Function Expression has 70 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function Expression () {
          
            this.op = (op) => {
              if (! this._op) {
                this._op = op;
          Severity: Major
          Found in server/filter.js - About 2 hrs to fix

            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

              Function componentWillReceiveProps has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
              Open

                componentWillReceiveProps (nextProps) {
                  var { directory, phase, response, roles } = nextProps;
                  if (directory.certificate && 'Connecting' === this.state.busy) {
                    this.setState({ busy: undefined });
                  } else if ('search' === phase && 'Verifying' === this.state.busy) {
              Severity: Minor
              Found in src/js/components/settings/DirectoryEdit.js - About 2 hrs 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

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

                render () {
                  const { productName } = this.props;
                  const { settings, errors } = this.state;
              
                  let networkErrors;
              Severity: Major
              Found in src/js/components/settings/IdentityEdit.js - About 2 hrs to fix

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

                  _onSearch (event) {
                    const { index } = this.props;
                    const searchText = event.target.value;
                    this.setState({ searchText });
                    const query = new Query(searchText);
                Severity: Major
                Found in src/js/components/size/SizeIndex.js and 3 other locations - About 2 hrs to fix
                src/js/components/activity/ActivityIndex.js on lines 64..70
                src/js/components/image/ImageIndex.js on lines 57..63
                src/js/components/virtualMachine/VirtualMachineIndex.js on lines 82..88

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

                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

                        <ListPlaceholder filteredTotal={result.total}
                          unfilteredTotal={result.unfilteredTotal}
                          emptyMessage='You do not have any images at the moment.'
                          addControl={
                            <Button icon={<AddIcon />} label='Add image'
                Severity: Major
                Found in src/js/components/image/ImageIndex.js and 2 other locations - About 2 hrs to fix
                src/js/components/size/SizeIndex.js on lines 96..103
                src/js/components/virtualMachine/VirtualMachineIndex.js on lines 222..229

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

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

                  _onSearch (event) {
                    const { index } = this.props;
                    const searchText = event.target.value;
                    this.setState({ searchText });
                    const query = new Query(searchText);
                Severity: Major
                Found in src/js/components/activity/ActivityIndex.js and 3 other locations - About 2 hrs to fix
                src/js/components/image/ImageIndex.js on lines 57..63
                src/js/components/size/SizeIndex.js on lines 40..46
                src/js/components/virtualMachine/VirtualMachineIndex.js on lines 82..88

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

                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

                        <ListPlaceholder filteredTotal={result.total}
                          unfilteredTotal={result.unfilteredTotal}
                          emptyMessage='You do not have any sizes at the moment.'
                          addControl={
                            <Button icon={<AddIcon />} label='Add size'
                Severity: Major
                Found in src/js/components/size/SizeIndex.js and 2 other locations - About 2 hrs to fix
                src/js/components/image/ImageIndex.js on lines 125..132
                src/js/components/virtualMachine/VirtualMachineIndex.js on lines 222..229

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

                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