wowserhq/wowser

View on GitHub

Showing 49 of 114 total issues

File index.js has 410 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import THREE from 'three';

import Submesh from './submesh';
import M2Material from './material';
import AnimationManager from './animation-manager';
Severity: Minor
Found in src/lib/pipeline/m2/index.js - About 5 hrs to fix

    File wmo-handler.js has 287 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import ContentQueue from '../content-queue';
    import WMOBlueprint from '../../../pipeline/wmo/blueprint';
    import WMOGroupBlueprint from '../../../pipeline/wmo/group/blueprint';
    import M2Blueprint from '../../../pipeline/m2/blueprint';
    
    
    Severity: Minor
    Found in src/lib/game/world/wmo-manager/wmo-handler.js - About 2 hrs to fix

      Function createSkeleton has 69 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        createSkeleton(boneDefs) {
          const rootBones = [];
          const bones = [];
          const billboards = [];
      
      
      Severity: Major
      Found in src/lib/pipeline/m2/index.js - About 2 hrs to fix

        Function update has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
        Open

          update() {
            const unit = this.unit;
        
            // TODO: Get rid of this delta retrieval call
            const delta = this.clock.getDelta();
        Severity: Minor
        Found in src/components/game/controls.jsx - 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 constructor has 63 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          constructor(wmo, id, data, path) {
            super();
        
            this.dispose = ::this.dispose;
        
        
        Severity: Major
        Found in src/lib/pipeline/wmo/group/index.js - About 2 hrs to fix

          File index.js has 268 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import THREE from 'three';
          
          import TextureLoader from '../../texture-loader';
          import vertexShader from './shader.vert';
          import fragmentShader from './shader.frag';
          Severity: Minor
          Found in src/lib/pipeline/m2/material/index.js - About 2 hrs to fix

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

              dataReceived(_socket) {
                while (true) {
                  if (!this.connected) {
                    return;
                  }
            Severity: Minor
            Found in src/lib/game/handler.js - 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 constructor has 60 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              constructor(adt, id) {
                super();
            
                this.matrixAutoUpdate = false;
            
            
            Severity: Major
            Found in src/lib/pipeline/adt/chunk/index.js - About 2 hrs to fix

              Function applyBlendingMode has 57 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                applyBlendingMode(blendingMode) {
                  this.uniforms.blendingMode.value = blendingMode;
              
                  if (blendingMode === 1) {
                    this.uniforms.alphaKey = { type: 'f', value: 1.0 };
              Severity: Major
              Found in src/lib/pipeline/m2/material/index.js - About 2 hrs to fix

                Function feed has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  feed(s, B, I, P) {
                
                    // Generated salt (s) and server's public ephemeral value (B)
                    this._s = BigNum.fromArray(s);
                    this._B = BigNum.fromArray(B);
                Severity: Major
                Found in src/lib/crypto/srp.js - About 2 hrs to fix

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

                    createSkeleton(boneDefs) {
                      const rootBones = [];
                      const bones = [];
                      const billboards = [];
                  
                  
                  Severity: Minor
                  Found in src/lib/pipeline/m2/index.js - 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

                  WMOHandler has 21 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  class WMOHandler {
                  
                    static LOAD_GROUP_INTERVAL = 1;
                    static LOAD_GROUP_WORK_FACTOR = 1 / 10;
                    static LOAD_GROUP_WORK_MIN = 2;
                  Severity: Minor
                  Found in src/lib/game/world/wmo-manager/wmo-handler.js - About 2 hrs to fix

                    Function createDef has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      createDef(data, batchData) {
                        const def = this.stubDef();
                    
                        const { textures } = data;
                        const { vertexColorAnimations, transparencyAnimations, uvAnimations } = data;
                    Severity: Major
                    Found in src/lib/pipeline/m2/batch-manager.js - About 2 hrs to fix

                      Function update has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        update() {
                          const unit = this.unit;
                      
                          // TODO: Get rid of this delta retrieval call
                          const delta = this.clock.getDelta();
                      Severity: Major
                      Found in src/components/game/controls.jsx - About 2 hrs to fix

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

                          constructor(def, textureDefs) {
                            super();
                        
                            this.textures = [];
                        
                        
                        Severity: Minor
                        Found in src/lib/pipeline/wmo/material/index.js - About 2 hrs to fix

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

                            constructor(m2, def) {
                              if (def.useSkinning) {
                                super({ skinning: true });
                              } else {
                                super({ skinning: false });
                          Severity: Minor
                          Found in src/lib/pipeline/m2/material/index.js - About 1 hr to fix

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

                              mapStats() {
                                const map = this.props.map;
                            
                                return (
                                  <div>
                            Severity: Minor
                            Found in src/components/game/stats/index.jsx - About 1 hr to fix

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

                                constructor(path, data, skinData, instance = null) {
                                  super();
                              
                                  this.matrixAutoUpdate = false;
                              
                              
                              Severity: Minor
                              Found in src/lib/pipeline/m2/index.js - About 1 hr to fix

                                Function handleCharacterList has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  handleCharacterList(gp) {
                                    const count = gp.readByte(); // number of characters
                                
                                    this.list.length = 0;
                                
                                
                                Severity: Minor
                                Found in src/lib/characters/handler.js - About 1 hr to fix

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

                                    render() {
                                      return (
                                        <kit className="screen">
                                          <div className="frame thin">
                                            <h2>Thin frame</h2>
                                  Severity: Minor
                                  Found in src/components/kit/index.jsx - About 1 hr to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language