taburetkin/marionette.yat

View on GitHub

Showing 58 of 67 total issues

Function compareAB has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

export function compareAB(a, b, func, getArgs) {
    if (arguments.length === 2) {

        if (a < b) return -1;
        if (a > b) return 1;
Severity: Minor
Found in utils/compare-utils.js - About 4 hrs 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 _initializePromise has 65 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    _initializePromise(options) {
        if (!this.getOption('promiseEnabled')) return;

        this.mergeOptions(options, ['mapResult']);

Severity: Major
Found in mixins/actAsPromiseMixin.js - About 2 hrs to fix

    Function enableStateModel has 55 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        enableStateModel() {
            if (!this.stateModel) {
                this.stateModel = this.buildStateModel();
            }
            let state = this.stateModel;
    Severity: Major
    Found in coms/stateModel/viewWithStateModel-mixin.js - About 2 hrs to fix

      Function normalizeArgs has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

      function normalizeArgs(ownArgs, cmnArgs, cmnArgsIndex = 0, ownArgsIndex = 0) {
          if (cmnArgs == null && ownArgs == null) {
      
              return;
      
      
      Severity: Minor
      Found in utils/build-utils.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 compareAB has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function compareAB(a, b, func, getArgs) {
          if (arguments.length === 2) {
      
              if (a < b) return -1;
              if (a > b) return 1;
      Severity: Minor
      Found in utils/compare-utils.js - About 1 hr to fix

        Function validateAsync has 32 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            async validateAsync(value, options = {}) {
                if (!arguments.length) {
                    value = this.getValue();
                }
                let children = this.hasChildren();
        Severity: Minor
        Found in coms/controls/control.js - About 1 hr to fix

          Function _createRoutes has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

              _createRoutes() {
                  if (this._routes) return;
                  let routes = this.getOption('routes');
                  if (routes == null) return;
                  if (_.isString(routes)) {
          Severity: Minor
          Found in routing/page/routes-mixin.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 ModelSchemas has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

          function ModelSchemas(type, schema, opts = {}) {
              if (typeof type !== 'string' && typeof type !== 'function') {
                  throw new Error('Type must be a string or a function');
              }
              if (arguments.length === 1) {
          Severity: Minor
          Found in coms/modelSchemas/schemas.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 _buildRoute has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

              _buildRoute(routeKey, arg) {
                  if (_.isString(arg)) {
                      return this._buildRoute(routeKey, { route: arg })
                  } else if (_.isFunction(arg)) {
                      return this._buildRoute(routeKey, arg.call(this, routeKey));
          Severity: Minor
          Found in routing/page/routes-mixin.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 camelCase has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

          export default function camelCase(...args) {
          
              let text;
              let first;
          
          
          Severity: Minor
          Found in utils/camelCase.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 _initProps has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

              _initProps(properties) {
                  let keys;
                  let get;
                  if (Array.isArray(properties)) {
                      keys = new Array(properties.length);
          Severity: Minor
          Found in coms/modelSchemas/ModelSchema.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 buildRouteUrl has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

          export default function buildRouteUrl(route, data = {}, search = '', hash = '') {
          
              // normalizing search and hash;
              search = search && search.toString() || ''; // if its a URLSearchParams
              if (search && search[0] !== '?') {
          Severity: Minor
          Found in utils/buildRouteUrl.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 createRawContext has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

          function createRawContext(arg, store) {
              if (isInstance(arg, ActorApi)) {
                  return { action: arg };
              } else if (_.isString(arg) && isInstance(store[arg], ActorApi)) {
                  return { action: store[arg] };
          Severity: Minor
          Found in coms/api/actorApiMixin.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 validateAsync has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

              async validateAsync(value, options = {}) {
                  if (!arguments.length) {
                      value = this.getValue();
                  }
                  let children = this.hasChildren();
          Severity: Minor
          Found in coms/controls/control.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 hasFlags has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

          export function hasFlags(allflags, expected, options = {}) {
              if (allflags == null || expected == null) return false;
              if (_.isNumber(expected)) {
                  if (_.isNumber(allflags)) {
                      return options.any ? ((allflags & expected) > 0) : ((allflags & expected) == expected); /* eslint-disable-line */
          Severity: Minor
          Found in utils/enum-utils.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 constructor has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              constructor(options = {}) {
                  if (options.http == null) {
                      throw new Error('http not provided');
                  }
                  Api.apply(this, arguments);
          Severity: Minor
          Found in coms/api/restApi.js - About 1 hr to fix

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

            function ModelSchemas(type, schema, opts = {}) {
                if (typeof type !== 'string' && typeof type !== 'function') {
                    throw new Error('Type must be a string or a function');
                }
                if (arguments.length === 1) {
            Severity: Minor
            Found in coms/modelSchemas/schemas.js - About 1 hr to fix

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

              export function buildInstanceByKey(context, key, buildOptions = {}) {
                  if (!buildOptions.ctorArgs) {
                      let { keyToCamelCase, defaultOptions, options, optionsKey } = buildOptions;
                      if (!optionsKey) {
                          optionsKey = keyToCamelCase ? camelCase(key, 'options') : key + 'Options';
              Severity: Minor
              Found in utils/build-utils.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 buildItem has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

              export function buildItem(arg, buildOptions = {}) {
                  if (arg == null) return;
              
                  let { BaseClass, ctorArgs, ctorArgsIndex, context } = buildOptions;
              
              
              Severity: Minor
              Found in utils/build-utils.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 normalizeActionContext has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

              function normalizeActionContext(callContext, ac) {
                  if (ac && ac._normalized) {
                      return ac;
                  }
                  if (ac && isInstance(ac.action, ActorApi)) {
              Severity: Minor
              Found in coms/api/actorApiMixin.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

              Severity
              Category
              Status
              Source
              Language