RobotlegsJS/RobotlegsJS

View on GitHub

Showing 25 of 77 total issues

Context has 43 functions (exceeds 20 allowed). Consider refactoring.
Open

@injectable()
export class Context extends EventDispatcher implements IContext {
    /*============================================================================*/
    /* Public Properties                                                          */
    /*============================================================================*/
Severity: Minor
Found in src/robotlegs/bender/framework/impl/Context.ts - About 5 hrs to fix

    Lifecycle has 35 functions (exceeds 20 allowed). Consider refactoring.
    Open

    export class Lifecycle implements ILifecycle {
        /*============================================================================*/
        /* Public Properties                                                          */
        /*============================================================================*/
    
    
    Severity: Minor
    Found in src/robotlegs/bender/framework/impl/Lifecycle.ts - About 4 hrs to fix

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

      module.exports = env => {
      
        if (!env) env = { production: false, karma: false };
      
        let mode = env.production ? "production" : "development";
      Severity: Major
      Found in webpack.config.js - About 2 hrs to fix

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

        module.exports = config => {
            "use strict";
        
            var configuration = {
                basePath: "",
        Severity: Major
        Found in karma.conf.js - About 2 hrs to fix

          Function executeCommand has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
          Open

              public executeCommand(mapping: ICommandMapping, payload?: CommandPayload): void {
                  let hasPayload: boolean = payload && payload.hasPayload();
                  let injectionEnabled: boolean = hasPayload && mapping.payloadInjectionEnabled;
                  let command: ICommand = null;
          
          
          Severity: Minor
          Found in src/robotlegs/bender/extensions/commandCenter/impl/CommandExecutor.ts - About 2 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 guardsApprove has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
          Open

          export function guardsApprove(guards: any[], injector?: IInjector): boolean {
              for (let guard of guards) {
                  if (typeof guard === "function" && guard.prototype.approve === undefined) {
                      if ((<Function>guard)()) {
                          continue;
          Severity: Minor
          Found in src/robotlegs/bender/framework/impl/guardsApprove.ts - 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 enter has 41 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public enter(callback?: Function): void {
                  // immediately call back if we have already transitioned, and exit
                  if (this._lifecycle.state === this._finalState) {
                      if (callback) {
                          safelyCallBack(callback, null, this._name);
          Severity: Minor
          Found in src/robotlegs/bender/framework/impl/LifecycleTransition.ts - About 1 hr to fix

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

                public matches(item: any): boolean {
                    let i: number = this._allOfTypes.length;
            
                    while (i--) {
                        if (!isInstanceOfType(item, this._allOfTypes[i])) {
            Severity: Minor
            Found in src/robotlegs/bender/extensions/matching/TypeFilter.ts - 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 a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

            module.exports = env => {
            
              if (!env) env = { production: false, karma: false };
            
              let mode = env.production ? "production" : "development";
            Severity: Minor
            Found in webpack.config.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 next has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private next(): void {
                    // Try to keep things synchronous with a simple loop,
                    // forcefully breaking out for async handlers and recursing.
                    // We do this to avoid increasing the stack depth unnecessarily.
                    let handler: Function;
            Severity: Minor
            Found in src/robotlegs/bender/framework/impl/MessageRunner.ts - About 1 hr to fix

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

                  public executeCommand(mapping: ICommandMapping, payload?: CommandPayload): void {
                      let hasPayload: boolean = payload && payload.hasPayload();
                      let injectionEnabled: boolean = hasPayload && mapping.payloadInjectionEnabled;
                      let command: ICommand = null;
              
              

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

                    private _notifyListener(event: IEvent, capturePhase: boolean): boolean {
                        let values = this._eventDispatcher;
                        let eventMap: any = this._getEventMap(capturePhase);
                        let list: IEventBin[] = eventMap[event.type];
                        if (!list) {
                Severity: Minor
                Found in src/robotlegs/bender/events/impl/EventDispatcher.ts - About 1 hr to fix

                  Function applyHooks has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export function applyHooks(hooks: any[], injector?: IInjector): void {
                      for (let hook of hooks) {
                          if (typeof hook === "function" && hook.prototype.hook === undefined) {
                              (<Function>hook)();
                              continue;
                  Severity: Minor
                  Found in src/robotlegs/bender/framework/impl/applyHooks.ts - 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 _insertEventBin has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      private _insertEventBin(
                          list: any[],
                          type: string,
                          listener: Function,
                          thisObject?: any,
                  Severity: Minor
                  Found in src/robotlegs/bender/events/impl/EventDispatcher.ts - About 1 hr to fix

                    Function unmapListener has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public unmapListener(
                            dispatcher: IEventDispatcher,
                            eventString: string,
                            listener: Function,
                            thisObject?: any,
                    Severity: Minor
                    Found in src/robotlegs/bender/extensions/localEventMap/impl/EventMap.ts - About 45 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 _notifyListener has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                        private _notifyListener(event: IEvent, capturePhase: boolean): boolean {
                            let values = this._eventDispatcher;
                            let eventMap: any = this._getEventMap(capturePhase);
                            let list: IEventBin[] = eventMap[event.type];
                            if (!list) {
                    Severity: Minor
                    Found in src/robotlegs/bender/events/impl/EventDispatcher.ts - About 45 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 install has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public install(extension: any): void {
                            if (typeof extension === "function" && extension.prototype.extend !== undefined) {
                                if (!this._classes.get(extension)) {
                                    this.install(new extension());
                                }
                    Severity: Minor
                    Found in src/robotlegs/bender/framework/impl/ExtensionInstaller.ts - About 45 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 enter has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public enter(callback?: Function): void {
                            // immediately call back if we have already transitioned, and exit
                            if (this._lifecycle.state === this._finalState) {
                                if (callback) {
                                    safelyCallBack(callback, null, this._name);
                    Severity: Minor
                    Found in src/robotlegs/bender/framework/impl/LifecycleTransition.ts - About 45 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 _insertEventBin has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                        private _insertEventBin(
                            list: any[],
                            type: string,
                            listener: Function,
                            thisObject?: any,
                    Severity: Minor
                    Found in src/robotlegs/bender/events/impl/EventDispatcher.ts - About 45 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 next has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                        private next(): void {
                            // Try to keep things synchronous with a simple loop,
                            // forcefully breaking out for async handlers and recursing.
                            // We do this to avoid increasing the stack depth unnecessarily.
                            let handler: Function;
                    Severity: Minor
                    Found in src/robotlegs/bender/framework/impl/MessageRunner.ts - 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