BabylonJS/Spector.js

View on GitHub

Showing 266 of 572 total issues

Function buildConfig has 63 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var buildConfig = function(env) {
    var isProd = env.prod;

    var config = {
        watch: !isProd,
Severity: Major
Found in tools/webpack.config.js - About 2 hrs to fix

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

    function initBuffers() {
    
      // Create a buffer for the cube's vertices.
    
      cubeVerticesBuffer = gl.createBuffer();
    Severity: Major
    Found in sample/js/customMetadata.js - About 2 hrs to fix

      Function render has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
      Open

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

      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 composeInContainer has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
      Open

          public composeInContainer(parentContainer: Element, indexInContainer: number, lastOperation: LastOperation): Element {
              if (lastOperation === LastOperation.Delete) {
                  this.removeNode();
                  return null;
              }
      Severity: Minor
      Found in src/embeddedFrontend/mvx/componentInstance.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 readFrameBufferFromContext has a Cognitive Complexity of 18 (exceeds 5 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 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 render has 60 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public render(state: ISourceCodeState, stateId: number): Element {
              const source = state.fragment ? state.sourceFragment : state.sourceVertex;
              let originalShader: string;
              let preprocessed = state.preprocessed;
      
      
      Severity: Major
      Found in src/embeddedFrontend/resultView/sourceCode/sourceCodeComponent.ts - About 2 hrs to fix

        Function initBuffers has 59 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function initBuffers() {
        
          // Create a buffer for the cube's vertices.
        
          cubeVerticesBuffer = gl.createBuffer();
        Severity: Major
        Found in sample/js/uniformCommand.js - About 2 hrs to fix

          Function initBuffers has 59 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function initBuffers() {
          
            // Create a buffer for the cube's vertices.
          
            cubeVerticesBuffer = gl.createBuffer();
          Severity: Major
          Found in sample/js/transient.js - About 2 hrs to fix

            Function initBuffers has 59 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function initBuffers() {
            
              // Create a buffer for the cube's vertices.
            
              cubeVerticesBuffer = gl.createBuffer();
            Severity: Major
            Found in sample/js/customShaderName.js - About 2 hrs to fix

              Function initBuffers has 59 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function initBuffers() {
              
                // Create a buffer for the cube's vertices.
              
                cubeVerticesBuffer = gl.createBuffer();
              Severity: Major
              Found in sample/js/customMarker.js - About 2 hrs to fix

                Function initBuffers has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function initBuffers() {
                
                  // Create a buffer for the cube's vertices.
                
                  cubeVerticesBuffer = gl.createBuffer();
                Severity: Major
                Found in sample/js/customLog.js - About 2 hrs to fix

                  Function initBuffers has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function initBuffers() {
                  
                    // Create a buffer for the cube's vertices.
                  
                    cubeVerticesBuffer = gl.createBuffer();
                  Severity: Major
                  Found in sample/js/stencilBits.js - About 2 hrs to fix

                    Function initBuffers has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function initBuffers() {
                    
                      // Create a buffer for the cube's vertices.
                    
                      cubeVerticesBuffer = gl.createBuffer();
                    Severity: Major
                    Found in sample/js/scissorClear.js - About 2 hrs to fix

                      Function initBuffers has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function initBuffers() {
                      
                        // Create a buffer for the cube's vertices.
                      
                        cubeVerticesBuffer = gl.createBuffer();
                      Severity: Major
                      Found in sample/js/setTimeout.js - About 2 hrs to fix

                        Function initBuffers has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function initBuffers() {
                        
                          // Create a buffer for the cube's vertices.
                        
                          cubeVerticesBuffer = gl.createBuffer();
                        Severity: Major
                        Found in sample/js/simpleNoCommand.js - About 2 hrs to fix

                          Function initBuffers has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function initBuffers() {
                          
                            // Create a buffer for the cube's vertices.
                          
                            cubeVerticesBuffer = gl.createBuffer();
                          Severity: Major
                          Found in sample/js/simple.js - About 2 hrs to fix

                            Function initBuffers has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            function initBuffers() {
                            
                              // Create a buffer for the cube's vertices.
                            
                              cubeVerticesBuffer = gl.createBuffer();
                            Severity: Major
                            Found in sample/js/depthRange.js - About 2 hrs to fix

                              BaseState has 22 functions (exceeds 20 allowed). Consider refactoring.
                              Open

                              export abstract class BaseState {
                                  public abstract get stateName(): string;
                              
                                  protected readonly context: WebGLRenderingContexts;
                                  protected readonly contextVersion: number;
                              Severity: Minor
                              Found in src/backend/states/baseState.ts - About 2 hrs to fix

                                File visualState.ts has 263 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                import { BaseState } from "../baseState";
                                import { WebGlConstants, WebGlConstantsByValue, WebGlConstantsByName, WebGlConstant } from "../../types/webglConstants";
                                import { ReadPixelsHelper } from "../../utils/readPixelsHelper";
                                import { ICommandCapture } from "../../../shared/capture/commandCapture";
                                import { drawCommands } from "../../utils/drawCommands";
                                Severity: Minor
                                Found in src/backend/states/context/visualState.ts - About 2 hrs to fix

                                  Function createCommands has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      private createCommands(capture: ICapture): void {
                                          this.mvx.removeChildrenStates(this.commandListStateId);
                                          let tempVisualStateId = this.initVisualStateId;
                                          let visualStateSet = false;
                                  
                                  
                                  Severity: Minor
                                  Found in src/embeddedFrontend/resultView/resultView.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

                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language