asdqwex/doplr

View on GitHub

Showing 9 of 15 total issues

Function exports has 46 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = function (React, helpers) {
  const Mainmenu = React.createClass({
    render: function() {
      const hosts = this.props.hostData;
      const events = this.props.eventData;
Severity: Minor
Found in www/partials/mainmenu.jsx - About 1 hr to fix

    Function SweepFactory has 45 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    module.exports = function SweepFactory (helpers) {
      const CONSTANTS = helpers.CONSTANTS;
      class Sweep {
    
        constructor (options) {
    Severity: Minor
    Found in lib/sweep.js - About 1 hr to fix

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

          render: function() {
            const hosts = this.props.hostData;
            const events = this.props.eventData;
            const healthColor = helpers.healthColor;
            let overallHealth = Math.round(
      Severity: Minor
      Found in www/partials/mainmenu.jsx - About 1 hr to fix

        Function SweepFactory has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

        module.exports = function SweepFactory (helpers) {
          const CONSTANTS = helpers.CONSTANTS;
          class Sweep {
        
            constructor (options) {
        Severity: Minor
        Found in lib/sweep.js - 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 exports has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        module.exports = function (React, helpers) {
          const HostSearchPaneItem = React.createClass({
            render: function() {
              const hostData = this.props.hostData;
              const healthColor = helpers.healthColor;
        Severity: Minor
        Found in www/partials/hostSearchPane.jsx - About 1 hr to fix

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

          module.exports = function RadarFactory (helpers) {
            return class Radar {
          
              constructor (options) {
                this.log = helpers.logger(options);
          Severity: Minor
          Found in lib/radar.js - About 1 hr to fix

            Avoid deeply nested control flow statements.
            Open

                  if (typeof Doplr.Sweep.types[sweepType] === 'string') {
                    sweepType = sweep.types[sweepType];
                  }
            Severity: Major
            Found in bin/doplr.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                    if (Doplr.Sweep.types[sweepType] === undefined) {
                      type = 'host';
                      target = sweepType;
                    } else {
                      type = sweepType;
              Severity: Major
              Found in bin/doplr.js - About 45 mins to fix

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

                module.exports = function (options) {
                  options = options || {};
                  // Logging (should probably use winston here)
                  const logger = function () {
                    if (!options.silent) { console.log.apply(console, arguments); }
                Severity: Minor
                Found in lib/logger.js - 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

                Severity
                Category
                Status
                Source
                Language