JiriChara/kindergarten

View on GitHub

Showing 7 of 11 total issues

Function guard has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
Open

const guard = (...args) => {
  /**
   * Name of the action that should be guarded.
   */
  const action = args[0];
Severity: Minor
Found in src/decorators/guard.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 exports has 40 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = function (config) {
  config.set({

    // base path that will be used to resolve all patterns (eg. files, exclude)
    basePath: '',
Severity: Minor
Found in karma.conf.js - About 1 hr to fix

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

    const guard = (...args) => {
      /**
       * Name of the action that should be guarded.
       */
      const action = args[0];
    Severity: Minor
    Found in src/decorators/guard.js - About 1 hr to fix

      Function sandbox has 30 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const sandbox = (...sandboxArgs) => (Target) => {
        const sandboxInstance = new Sandbox(...sandboxArgs);
      
        const addMethod = (obj, key, value) => {
          if (obj[key]) {
      Severity: Minor
      Found in src/decorators/sandbox.js - About 1 hr to fix

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

          _loadPerimeter(perimeter) {
            if (!isPerimeter(perimeter)) {
              throw new ArgumentError(
                'Cannot load perimeter. Is it an instance of perimeter?'
              );
        Severity: Minor
        Found in src/Purpose.js - About 1 hr to fix

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

            constructor(purpose, opts = {}) {
              if (isObject(purpose) && isString(purpose.purpose)) {
                opts = purpose;
                this.purpose = purpose.purpose;
              }
          Severity: Minor
          Found in src/Perimeter.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

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

            set governess(value) {
              // if governess is null perimeter will use the governess of it's sandbox
              this._governess = (isGoverness(value)) ?
                value : (() => (
                  isSandbox(this.sandbox) ? this.sandbox.governess : null
          Severity: Minor
          Found in src/Perimeter.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

          Severity
          Category
          Status
          Source
          Language