Showing 835 of 1,558 total issues

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

DataSet.prototype.add = function (data, senderId) {
  var addedIds = [],
      id,
      me = this;

Severity: Minor
Found in lib/DataSet.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

Avoid too many return statements within this function.
Open

        return new Date(object);
Severity: Major
Found in lib/util.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

        return 'String';
    Severity: Major
    Found in lib/util.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

              return object.toDate().toISOString();
      Severity: Major
      Found in lib/util.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                return '/Date(' + object + ')/';
        Severity: Major
        Found in lib/util.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

            return type;
          Severity: Major
          Found in lib/util.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                  return 'Array';
            Severity: Major
            Found in lib/util.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                      return Number(object.valueOf());
              Severity: Major
              Found in lib/util.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                          return moment(new Date(object)).toDate(); // parse string
                Severity: Major
                Found in lib/util.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                            return moment(object); // parse string
                  Severity: Major
                  Found in lib/util.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                        return 'Boolean';
                    Severity: Major
                    Found in lib/util.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                return moment(Number(match[1])); // parse number
                      Severity: Major
                      Found in lib/util.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                              return 'Date';
                        Severity: Major
                        Found in lib/util.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                              return 'Object';
                          Severity: Major
                          Found in lib/util.js - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                return 'undefined';
                            Severity: Major
                            Found in lib/util.js - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                  return time;
                              Severity: Major
                              Found in lib/timeline/DateUtil.js - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                        return '/Date(' + value + ')/';
                                Severity: Major
                                Found in lib/util.js - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                      return 'Number';
                                  Severity: Major
                                  Found in lib/util.js - About 30 mins to fix

                                    Avoid too many return statements within this function.
                                    Open

                                            return '/Date(' + object.valueOf() + ')/';
                                    Severity: Major
                                    Found in lib/util.js - About 30 mins to fix

                                      Avoid too many return statements within this function.
                                      Open

                                              return new Date(object);
                                      Severity: Major
                                      Found in lib/util.js - About 30 mins to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language