leafjs/orient

View on GitHub

Showing 143 of 143 total issues

Avoid too many return statements within this function.
Open

        return this;
Severity: Major
Found in src/schemas/index.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

            return BooleanType;
    Severity: Major
    Found in src/types/convert.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

              return DateType;
      Severity: Major
      Found in src/types/convert.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                return data.get(newPath);
        Severity: Major
        Found in src/data.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                  return NumberType;
          Severity: Major
          Found in src/types/convert.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                    return propertyName + ' ' + operator + ' ' + param;
            Severity: Major
            Found in src/query.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                              return items.push(query);
              Severity: Major
              Found in src/query.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                        return data.get(newPath);
                Severity: Major
                Found in src/data.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                          return this;
                  Severity: Major
                  Found in src/data.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                return this;
                    Severity: Major
                    Found in src/data.js - About 30 mins to fix

                      Function isModified has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          isModified(path) {
                              var pos = path.indexOf('.');
                              if(pos === -1) {
                                  if(!this._data[path]) {
                                      log('isModified Path not exists:' + path);
                      Severity: Minor
                      Found in src/data.js - About 25 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

                      Parsing error: 'import' and 'export' may appear only with 'sourceType: module'
                      Open

                      import Type from './type';
                      Severity: Minor
                      Found in src/types/virtual.js by eslint

                      For more information visit Source: http://eslint.org/docs/rules/

                      Move the invocation into the parens that contain the function.
                      Open

                                      schema.pre(name, (function(name){
                      Severity: Minor
                      Found in lib/index.js by eslint

                      Require IIFEs to be Wrapped (wrap-iife)

                      You can immediately invoke function expressions, but not function declarations. A common technique to create an immediately-invoked function expression (IIFE) is to wrap a function declaration in parentheses. The opening parentheses causes the contained function to be parsed as an expression, rather than a declaration.

                      // function expression could be unwrapped
                      var x = function () { return { y: 1 };}();
                      
                      // function declaration must be wrapped
                      function () { /* side effects */ }(); // SyntaxError

                      Rule Details

                      This rule requires all immediately-invoked function expressions to be wrapped in parentheses.

                      Options

                      This rule has two options, a string option and an object option.

                      String option:

                      • "outside" enforces always wrapping the call expression. The default is "outside".
                      • "inside" enforces always wrapping the function expression.
                      • "any" enforces always wrapping, but allows either style.

                      Object option:

                      • "functionPrototypeMethods": true additionally enforces wrapping function expressions invoked using .call and .apply. The default is false.

                      outside

                      Examples of incorrect code for the default "outside" option:

                      /*eslint wrap-iife: ["error", "outside"]*/
                      
                      var x = function () { return { y: 1 };}(); // unwrapped
                      var x = (function () { return { y: 1 };})(); // wrapped function expression

                      Examples of correct code for the default "outside" option:

                      /*eslint wrap-iife: ["error", "outside"]*/
                      
                      var x = (function () { return { y: 1 };}()); // wrapped call expression

                      inside

                      Examples of incorrect code for the "inside" option:

                      /*eslint wrap-iife: ["error", "inside"]*/
                      
                      var x = function () { return { y: 1 };}(); // unwrapped
                      var x = (function () { return { y: 1 };}()); // wrapped call expression

                      Examples of correct code for the "inside" option:

                      /*eslint wrap-iife: ["error", "inside"]*/
                      
                      var x = (function () { return { y: 1 };})(); // wrapped function expression

                      any

                      Examples of incorrect code for the "any" option:

                      /*eslint wrap-iife: ["error", "any"]*/
                      
                      var x = function () { return { y: 1 };}(); // unwrapped

                      Examples of correct code for the "any" option:

                      /*eslint wrap-iife: ["error", "any"]*/
                      
                      var x = (function () { return { y: 1 };}()); // wrapped call expression
                      var x = (function () { return { y: 1 };})(); // wrapped function expression

                      functionPrototypeMethods

                      Examples of incorrect code for this rule with the "inside", { "functionPrototypeMethods": true } options:

                      /* eslint wrap-iife: [2, "inside", { functionPrototypeMethods: true }] */
                      
                      var x = function(){ foo(); }()
                      var x = (function(){ foo(); }())
                      var x = function(){ foo(); }.call(bar)
                      var x = (function(){ foo(); }.call(bar))

                      Examples of correct code for this rule with the "inside", { "functionPrototypeMethods": true } options:

                      /* eslint wrap-iife: [2, "inside", { functionPrototypeMethods: true }] */
                      
                      var x = (function(){ foo(); })()
                      var x = (function(){ foo(); }).call(bar)

                      Source: http://eslint.org/docs/rules/

                      Parsing error: 'import' and 'export' may appear only with 'sourceType: module'
                      Open

                      import Graph from './graph';
                      Severity: Minor
                      Found in src/schemas/edge.js by eslint

                      For more information visit Source: http://eslint.org/docs/rules/

                      Parsing error: 'import' and 'export' may appear only with 'sourceType: module'
                      Open

                      import Type from './type';
                      Severity: Minor
                      Found in src/types/date.js by eslint

                      For more information visit Source: http://eslint.org/docs/rules/

                      Parsing error: 'import' and 'export' may appear only with 'sourceType: module'
                      Open

                      import Schema from './schemas/index';
                      Severity: Minor
                      Found in src/data.js by eslint

                      For more information visit Source: http://eslint.org/docs/rules/

                      Parsing error: 'import' and 'export' may appear only with 'sourceType: module'
                      Open

                      import {
                      Severity: Minor
                      Found in src/index.js by eslint

                      For more information visit Source: http://eslint.org/docs/rules/

                      Parsing error: 'import' and 'export' may appear only with 'sourceType: module'
                      Open

                      import Type from './type';
                      Severity: Minor
                      Found in src/types/number.js by eslint

                      For more information visit Source: http://eslint.org/docs/rules/

                      Parsing error: 'import' and 'export' may appear only with 'sourceType: module'
                      Open

                      import Graph from './graph';
                      Severity: Minor
                      Found in src/schemas/vertex.js by eslint

                      For more information visit Source: http://eslint.org/docs/rules/

                      Parsing error: 'import' and 'export' may appear only with 'sourceType: module'
                      Open

                      import Type from './type';
                      Severity: Minor
                      Found in src/types/string.js by eslint

                      For more information visit Source: http://eslint.org/docs/rules/

                      Severity
                      Category
                      Status
                      Source
                      Language