grommet/grommet-ferret

View on GitHub

Showing 151 of 386 total issues

File rest.js has 940 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// (C) Copyright 2014-2016 Hewlett Packard Enterprise Development LP

import express from 'express';
let router = express.Router();
import ws from "ws";
Severity: Major
Found in server/rest.js - About 2 days to fix

    Function reduce has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
    Open

    function reduce(result) {
      for (let name in result.categories) {
        if (result.categories.hasOwnProperty(name)) {
          let items = result.categories[name];
          if (items.length > REDUCE_LIMIT) {
    Severity: Minor
    Found in server/map.js - About 7 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

    File VirtualMachineAdd.js has 469 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    // (C) Copyright 2014-2016 Hewlett Packard Enterprise Development LP
    
    import React, { Component, PropTypes } from 'react';
    import { connect } from 'react-redux';
    import { addMultipleVms, loadVmSizes, loadVmImages,
    Severity: Minor
    Found in src/js/components/virtualMachine/VirtualMachineAdd.js - About 7 hrs to fix

      File generator.js has 454 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      // (C) Copyright 2014-2015 Hewlett Packard Enterprise Development LP
      
      import {
        addAssociation, addCategory, addResource, getItems, setSettings, setStatus
      } from './data';
      Severity: Minor
      Found in server/generator.js - About 6 hrs to fix

        Function Expression has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
        Open

        function Expression () {
        
          this.op = (op) => {
            if (! this._op) {
              this._op = op;
        Severity: Minor
        Found in server/filter.js - About 6 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

        File DirectoryEdit.js has 406 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        // (C) Copyright 2014-2016 Hewlett Packard Enterprise Development LP
        
        import React, { Component, PropTypes } from 'react';
        import { connect } from 'react-redux';
        import { changeDirectory, loadDirectoryCertificate, trustDirectory,
        Severity: Minor
        Found in src/js/components/settings/DirectoryEdit.js - About 5 hrs to fix

          File filter.js has 386 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          // (C) Copyright 2014-2015 Hewlett Packard Enterprise Development LP
          
          const TRACE_PARSING = false;
          const TRACE_MATCHING = false;
          
          
          Severity: Minor
          Found in server/filter.js - About 5 hrs to fix

            Function _onSubmit has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
            Open

              _onSubmit () {
                const { directory, phase } = this.props;
                const { credentials, needCredentials } = this.state;
                let errors = {...this.state.errors};
                let noErrors = true;
            Severity: Minor
            Found in src/js/components/settings/DirectoryEdit.js - About 5 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 108 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              render () {
                const { virtualMachine } = this.props;
                const { chartData, graphicSize } = this.state;
            
                const cpuData = [
            Severity: Major
            Found in src/js/components/virtualMachine/VirtualMachineMetrics.js - About 4 hrs to fix

              Function _onSubmit has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
              Open

                _onSubmit () {
                  let errors = { nodes: [] };
                  let noErrors = true;
              
                  this.state.nodes.forEach((node, index) => {
              Severity: Minor
              Found in src/js/components/settings/NodesEdit.js - About 3 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

              File VirtualMachineEdit.js has 317 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              // (C) Copyright 2014-2016 Hewlett Packard Enterprise Development LP
              
              import React, { Component, PropTypes } from 'react';
              import { connect } from 'react-redux';
              import { loadVmImages, loadItem, updateItem,
              Severity: Minor
              Found in src/js/components/virtualMachine/VirtualMachineEdit.js - About 3 hrs to fix

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

                  render () {
                    const { settings, setup, productName, role } = this.props;
                
                    let sessionMenu;
                    if (setup) {
                Severity: Major
                Found in src/js/components/settings/SettingsEdit.js - About 3 hrs to fix

                  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

                        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

                              Severity
                              Category
                              Status
                              Source
                              Language