GeoNode/geonode-viewer

View on GitHub

Showing 24 of 95 total issues

File geonode.jsx has 264 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React from 'react';
global.React = React;
import ReactDOM from 'react-dom';
global.ReactDOM = ReactDOM;
import 'core-js/fn/object/assign';
Severity: Minor
Found in src/components/geonode.jsx - About 2 hrs to fix

    Function updateMap has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

      updateMap(props) {
        if (props.config) {
          var tileServices = [];
          var errors = [];
          var filteredErrors = [];
    Severity: Minor
    Found in src/components/geonode.jsx - About 1 hr 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 39 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      render() {
        const {formatMessage} = this.props.intl;
        const actions = [
          <FlatButton className='save-btn' primary={true} label={formatMessage(messages.savemapbutton)} onTouchTap={this._handleSave.bind(this)} />,
          <FlatButton className='close-btn' label={formatMessage(messages.closebutton)} onTouchTap={this._handleClose.bind(this)} />
    Severity: Minor
    Found in src/components/saveView.jsx - About 1 hr to fix

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

        render() {
          var error;
          if (this.state.errors.length > 0) {
            var msg = '';
            for (var i = 0, ii = this.state.errors.length; i < ii; i++) {
      Severity: Minor
      Found in src/components/geonode.jsx - About 1 hr to fix

        Function selectorFactory has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function selectorFactory(dispatch) {
          let result = {};
          const resetMapId = () => {
            dispatch(setMapId(undefined));
          }
        Severity: Minor
        Found in src/components/saveContainer.jsx - About 1 hr to fix

          Function map has 29 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const map = (state = defaultState, action) => {
            switch(action.type) {
              case GET_MAP_ID:
                return state.id;
              case SET_MAP_ID:
          Severity: Minor
          Found in src/state/map/reducers.js - About 1 hr to fix

            Function createThumbnail has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export const createThumbnail = (obj_id, map) => {
              map.once('postcompose', function(evt) {
                var canvas = evt.context.canvas;
                canvas.toBlob(function(blob) {
                  var url = window.location.pathname.replace('/view', '');
            Severity: Minor
            Found in src/services/geonode.js - About 1 hr to fix

              Function render has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                render() {
                  var error;
                  if (this.state.errors.length > 0) {
                    var msg = '';
                    for (var i = 0, ii = this.state.errors.length; i < ii; i++) {
              Severity: Minor
              Found in src/components/geonode.jsx - About 35 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

              Don't use IDs in selectors.
              Open

              #debug {
              Severity: Minor
              Found in src/css/app.css by csslint

              Don't use IDs in selectors.
              Open

              #debug input {
              Severity: Minor
              Found in src/css/app.css by csslint

              Don't use IDs in selectors.
              Open

              #content, #main {
              Severity: Minor
              Found in src/css/app.css by csslint

              Don't use IDs in selectors.
              Open

              #save-button {
              Severity: Minor
              Found in src/css/app.css by csslint

              Don't use IDs in selectors.
              Open

              #map {
              Severity: Minor
              Found in src/css/app.css by csslint

              Don't use IDs in selectors.
              Open

              #globe-button {
              Severity: Minor
              Found in src/css/app.css by csslint

              Don't use IDs in selectors.
              Open

              #content, #main {
              Severity: Minor
              Found in src/css/app.css by csslint

              Don't use IDs in selectors.
              Open

              #rotate-button {
              Severity: Minor
              Found in src/css/app.css by csslint

              Don't use IDs in selectors.
              Open

              #zoom-buttons {
              Severity: Minor
              Found in src/css/app.css by csslint

              Use of !important
              Open

                max-height: 94vh !important;
              Severity: Minor
              Found in src/css/app.css by csslint

              Use of !important
              Open

                top: 20px !important;
              Severity: Minor
              Found in src/css/app.css by csslint

              Don't use IDs in selectors.
              Open

              #home-button {
              Severity: Minor
              Found in src/css/app.css by csslint
              Severity
              Category
              Status
              Source
              Language