BabylonJS/Spector.js

View on GitHub

Showing 266 of 572 total issues

Function loadFiles has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    private loadFiles(event: DragEvent): void {
        let filesToLoad: any = null;

        // Handling data transfer via drag'n'drop
        if (event && event.dataTransfer && event.dataTransfer.files) {
Severity: Minor
Found in src/embeddedFrontend/resultView/captureList/captureListComponent.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 areStatesEquals has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    protected areStatesEquals(a: any, b: any): boolean {
        if (typeof a !== typeof b) {
            return false;
        }

Severity: Minor
Found in src/backend/states/baseState.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 displayCurrentCommandDetail has 47 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private displayCurrentCommandDetail(commandState: ICommandListItemState): number {
        const command = commandState.capture;
        this.mvx.removeChildrenStates(this.commandDetailStateId);

        const visualState = this.mvx.getGenericState<any>(commandState.visualStateId);
Severity: Minor
Found in src/embeddedFrontend/resultView/resultView.ts - About 1 hr to fix

    Function readFrameBufferAttachmentFromContext has 47 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected readFrameBufferAttachmentFromContext(attachment: number): any {
            const target = WebGlConstants.FRAMEBUFFER.value;
            const type = this.context.getFramebufferAttachmentParameter(target, attachment, WebGlConstants.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE.value);
            if (type === WebGlConstants.NONE.value) {
                return undefined;
    Severity: Minor
    Found in src/backend/states/drawCalls/drawCallState.ts - About 1 hr to fix

      Function createScene has 46 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      var createScene = function (engine, canvas) {
          var scene = new BABYLON.Scene(engine);
      
          // Setup camera
          var camera = new BABYLON.ArcRotateCamera("Camera", 0, 0, 10, BABYLON.Vector3.Zero(), scene);
      Severity: Minor
      Found in sample/js/lights.js - About 1 hr to fix

        Function createScene has 46 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        var createScene = function (engine, canvas) {
            var scene = new BABYLON.Scene(engine);
        
            // Setup camera
            var camera = new BABYLON.ArcRotateCamera("Camera", 0, 0, 10, BABYLON.Vector3.Zero(), scene);
        Severity: Minor
        Found in sample/js/lightsException.js - About 1 hr to fix

          Function createScene has 46 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          var createScene = function (engine, canvas) {
              var scene = new BABYLON.Scene(engine);
          
              // Setup camera
              var camera = new BABYLON.ArcRotateCamera("Camera", 0, 0, 10, BABYLON.Vector3.Zero(), scene);
          Severity: Minor
          Found in sample/js/captureOnLoad.js - About 1 hr to fix

            Function createScene has 46 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            var createScene = function (engine, canvas) {
                var scene = new BABYLON.Scene(engine);
            
                // Setup camera
                var camera = new BABYLON.ArcRotateCamera("Camera", 0, 0, 10, BABYLON.Vector3.Zero(), scene);
            Severity: Minor
            Found in sample/js/lightsNoRender.js - About 1 hr to fix

              Function createScene has 46 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              var createScene = function (engine, canvas) {
                  var scene = new BABYLON.Scene(engine);
              
                  // Setup camera
                  var camera = new BABYLON.ArcRotateCamera("Camera", 0, 0, 10, BABYLON.Vector3.Zero(), scene);
              Severity: Minor
              Found in sample/js/quickCapture.js - About 1 hr to fix

                Function readTextureFromContext has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    protected readTextureFromContext(textureUnit: number, target: WebGlConstant): {} {
                        const activeTexture = this.context.getParameter(WebGlConstants.ACTIVE_TEXTURE.value);
                
                        this.context.activeTexture(WebGlConstants.TEXTURE0.value + textureUnit);
                        const textureState: any = {
                Severity: Minor
                Found in src/backend/states/drawCalls/drawCallState.ts - About 1 hr to fix

                  Function render has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public render(state: IVisualStateItem, stateId: number): Element {
                          const liHolder = document.createElement("li");
                          if (state.active) {
                              liHolder.className = "active";
                              setTimeout(() => {

                    Function appendToAnalysis has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        protected appendToAnalysis(capture: ICapture, analysis: IAnalysis): void {
                            if (!capture.commands) {
                                return;
                            }
                    
                    
                    Severity: Minor
                    Found in src/backend/analysers/primitivesAnalyser.ts - About 1 hr to fix

                      Function constructor has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          constructor(options: IContextInformation) {
                              super(options);
                      
                              this.extensionDefinition = [
                                  [{ name: "ANGLE_instanced_arrays", description: "" },
                      Severity: Minor
                      Found in src/backend/states/information/extensions.ts - About 1 hr to fix

                        Function createCapture has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public createCapture(functionInformation: IFunctionInformation, commandCaptureId: number, marker: string): ICommandCapture {
                                // Removes the spector internal calls to leave only th relevant part.
                                const stackTrace = StackTrace.getStackTrace(4, 1);
                        
                                // Includes uniform functions special cases to prevent lots of inheritence.
                        Severity: Minor
                        Found in src/backend/commands/baseCommand.ts - About 1 hr to fix

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

                          var loadFiles = function(event) {
                              var filesToLoad = null;
                          
                              // Handling data transfer via drag'n'drop
                              if (event && event.dataTransfer && event.dataTransfer.files) {
                          Severity: Minor
                          Found in extensions/popup.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 readFrameBufferAttachmentFromTexture has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                          Open

                              protected readFrameBufferAttachmentFromTexture(gl: WebGLRenderingContext | WebGL2RenderingContext,
                                  frameBuffer: WebGLFramebuffer, webglConstant: WebGlConstant,
                                  x: number, y: number, width: number, height: number,
                                  target: number, componentType: number, storage: any): void {
                                  let textureLayer = 0;
                          Severity: Minor
                          Found in src/backend/states/context/visualState.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 storeCommandIds has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                          Open

                              protected storeCommandIds(): void {
                                  const commandIdsStates = ["unusedCommandIds", "disabledCommandIds", "redundantCommandIds", "validCommandIds"];
                                  for (const commandIdsStatus of commandIdsStates) {
                                      this.currentState[commandIdsStatus] = [] as any;
                                  }
                          Severity: Minor
                          Found in src/backend/states/baseState.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 createCapture has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public createCapture(functionInformation: IFunctionInformation, commandCaptureId: number, marker: string): ICommandCapture {
                                  // Removes the spector internal calls to leave only th relevant part.
                                  const stackTrace = StackTrace.getStackTrace(4, 1);
                          
                                  // Includes uniform functions special cases to prevent lots of inheritence.
                          Severity: Minor
                          Found in src/backend/commands/baseCommand.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 stringifyParameterValue has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                          Open

                              protected stringifyParameterValue(value: any, parameter: IParameter): any {
                                  if (value === null) {
                                      return "null";
                                  }
                          
                          
                          Severity: Minor
                          Found in src/backend/states/parameterState.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 readFrameBufferFromContext has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              protected readFrameBufferFromContext(): any {
                                  const frameBuffer = this.context.getParameter(WebGlConstants.FRAMEBUFFER_BINDING.value);
                                  if (!frameBuffer) {
                                      return null;
                                  }
                          Severity: Minor
                          Found in src/backend/states/drawCalls/drawCallState.ts - About 1 hr to fix
                            Severity
                            Category
                            Status
                            Source
                            Language