grommet/grommet-ferret

View on GitHub

Showing 151 of 386 total issues

Function NOTIFICATIONS_LOAD_SUCCESS has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  [NOTIFICATIONS_LOAD_SUCCESS]: (state, action) => {
    const result = convertTimestamps(action.result);
    let alert, tasks, busy;
    let preserveUris = state.preserveUris.slice(0);
    result.items.forEach((item) => {
Severity: Minor
Found in src/js/reducers/notifications.js - About 1 hr to fix

    Function getItems has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function getItems (categoryName, raw) {
      let result = [];
      if (categoryName) {
        if (Array.isArray(categoryName)) {
          for (var i = 0; i < categoryName.length; i++) {
    Severity: Minor
    Found in server/data.js - About 1 hr to fix

      Function IdentitySection has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const IdentitySection = (props) => {
      
        const { productName, role, settings, onOpen } = props;
        let control;
        if ('read only' !== role) {
      Severity: Minor
      Found in src/js/components/settings/IdentitySection.js - About 1 hr to fix

        Function createAssociations has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function createAssociations () {
          SCHEMA.forEach(category => {
            if (category.hasOwnProperty('associations')) {
        
              for (let name in category.associations) {
        Severity: Minor
        Found in server/generator.js - About 1 hr to fix

          Function _onSubmit has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            _onSubmit () {
              let hypervisor = {...this.props.hypervisor};
              if (hypervisor.address && ! hypervisor.certificate) {
                this.setState({ busy: 'Connecting' });
                this.props.dispatch(loadHypervisorCertificate(hypervisor));
          Severity: Minor
          Found in src/js/components/settings/HypervisorEdit.js - About 1 hr to fix

            Function NOTIFICATIONS_LOAD_AGGREGATE_SUCCESS has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              [NOTIFICATIONS_LOAD_AGGREGATE_SUCCESS]: (state, action) => {
                // convert to a more useful format
                let status, count;
                action.result.forEach((value) => {
                  if ('critical' === value.value.toLowerCase() ||
            Severity: Minor
            Found in src/js/reducers/notifications.js - About 1 hr to fix

              Function filterUserQuery has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export function filterUserQuery (items, userQuery) {
                // handle quoted strings, e.g. 'a b' c "d e"
                const regexp = /'([^']+)'|"([^"]+)"|(\w+)/g;
                let matches;
                let terms = [];
              Severity: Minor
              Found in server/filter.js - About 1 hr to fix

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

                  render () {
                    const { productName, settings } = this.props;
                    const { nodes } = this.state;
                    const unmanagedNodes = this.state.nodes.filter(node => ! node.managed);
                
                
                Severity: Minor
                Found in src/js/components/settings/NodesEdit.js - About 1 hr to fix

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

                    render () {
                      const { productName, software } = this.props;
                  
                      return (
                        <LayerForm title="Update Software" submitLabel="Update"
                  Severity: Minor
                  Found in src/js/components/settings/Update.js - About 1 hr to fix

                    Function _renderSizeTiles has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      _renderSizeTiles () {
                        const { sizes, template, errors } = this.state;
                        let selectedIndex;
                        const sizeTiles = sizes.map((size, index) => {
                          if (size.name === template.size.name) {
                    Severity: Minor
                    Found in src/js/components/virtualMachine/VirtualMachineAdd.js - About 1 hr to fix

                      Function getIndex has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function getIndex (url, queryParams) {
                        let items = getItems(queryParams.category) || [];
                        const unfilteredTotal = items.length;
                        items = filteredItems(items, queryParams);
                      
                      
                      Severity: Minor
                      Found in server/rest.js - About 1 hr to fix

                        Function updateAggregateCounts has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function updateAggregateCounts (counts, resource, value, intervals) {
                          let count = null;
                          for (let i = 0; i < counts.length; i++) {
                            if (value === counts[i].value) {
                              count = counts[i];
                        Severity: Minor
                        Found in server/rest.js - About 1 hr to fix

                          Function initialize has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                          export function initialize (socketUrl, getFunction) {
                            if (!_state.initialized) {
                              if (_wsAvailable() && (_state.socketUrl || socketUrl)) {
                                if (!_state.ws) {
                                  _state.socketUrl = _state.socketUrl || socketUrl;
                          Severity: Minor
                          Found in src/js/actions/watch.js - About 55 mins 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 respondToRequest has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                          function respondToRequest (connection, request) {
                            let response = {op: 'update', id: request.id};
                          
                            try {
                              if ('/rest/index/resources' === request.uri) {
                          Severity: Minor
                          Found in server/rest.js - About 55 mins 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 a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                            render () {
                              const { settings, setup, productName, role } = this.props;
                          
                              let sessionMenu;
                              if (setup) {
                          Severity: Minor
                          Found in src/js/components/settings/SettingsEdit.js - About 55 mins 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 runTask has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                          function runTask (task, resource, handler) {
                            // allow caller to preset the percent complete
                            if (! task.percentComplete) {
                              task.percentComplete = 0;
                            }
                          Severity: Minor
                          Found in server/rest.js - About 55 mins 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 a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                            render() {
                              const { item, includeResource } = this.props;
                          
                              let icon;
                              if ('Active' === item.state || 'Locked' === item.state) {
                          Severity: Minor
                          Found in src/js/components/activity/ActivityTile.js - About 55 mins 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

                          Avoid deeply nested control flow statements.
                          Open

                                    if (! credentials.userName) {
                                      errors.userName = 'required';
                                      noErrors = false;
                                    }
                          Severity: Major
                          Found in src/js/components/settings/DirectoryEdit.js - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                        while (usedRoles[roles[index]]) index += 1;
                            Severity: Major
                            Found in src/js/components/settings/DirectoryEdit.js - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                        if (! credentials.password) {
                                          errors.password = 'required';
                                          noErrors = false;
                                        }
                              Severity: Major
                              Found in src/js/components/settings/DirectoryEdit.js - About 45 mins to fix
                                Severity
                                Category
                                Status
                                Source
                                Language