wowserhq/wowser

View on GitHub

Showing 49 of 114 total issues

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

  render() {
    const renderer = this.props.renderer;
    if (!renderer) {
      return null;
    }
Severity: Minor
Found in src/components/game/stats/index.jsx - About 1 hr to fix

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

      constructor(props) {
        super();
    
        this.element = document.body;
        this.unit = props.for;
    Severity: Minor
    Found in src/components/game/controls.jsx - About 1 hr to fix

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

        createDef(data, batchData) {
          const def = this.stubDef();
      
          const { textures } = data;
          const { vertexColorAnimations, transparencyAnimations, uvAnimations } = data;
      Severity: Minor
      Found in src/lib/pipeline/m2/batch-manager.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 handleLogonChallenge has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        handleLogonChallenge(ap) {
          ap.readUnsignedByte();
          const status = ap.readUnsignedByte();
      
          switch (status) {
      Severity: Minor
      Found in src/lib/auth/handler.js - About 1 hr to fix

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

          authenticate(account, password) {
            if (!this.connected) {
              return false;
            }
        
        
        Severity: Minor
        Found in src/lib/auth/handler.js - About 1 hr to fix

          Function mapStats has a Cognitive Complexity of 11 (exceeds 5 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

          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 loadTexture has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            loadTexture(textureDef) {
              const wrapS = THREE.RepeatWrapping;
              const wrapT = THREE.RepeatWrapping;
              const flipY = false;
          
          
          Severity: Minor
          Found in src/lib/pipeline/m2/material/index.js - About 1 hr to fix

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

              render() {
                return (
                  <auth className="auth screen">
                    <div className="panel">
                      <h1>Authentication</h1>
            Severity: Minor
            Found in src/components/auth/index.jsx - About 1 hr to fix

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

                constructor(manager, entry) {
                  this.manager = manager;
                  this.entry = entry;
                  this.root = null;
              
              
              Severity: Minor
              Found in src/lib/game/world/wmo-manager/wmo-handler.js - About 1 hr to fix

                Function unload has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  unload() {
                    this.unloading = true;
                
                    this.manager.entries.delete(this.entry.id);
                    this.manager.counters.loadedEntries--;
                Severity: Minor
                Found in src/lib/game/world/wmo-manager/wmo-handler.js - About 1 hr to fix

                  Function handleAuthChallenge has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    handleAuthChallenge(gp) {
                      console.info('handling auth challenge');
                  
                      gp.readUnsignedInt(); // (0x01)
                  
                  
                  Severity: Minor
                  Found in src/lib/game/handler.js - About 1 hr to fix

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

                      render() {
                        return (
                          <characters className="characters screen">
                            <div className="panel">
                              <h1>Character Selection</h1>
                    Severity: Minor
                    Found in src/components/characters/index.jsx - About 1 hr to fix

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

                        createUVAnimations(uvAnimationDefs) {
                          if (uvAnimationDefs.length === 0) {
                            return;
                          }
                      
                      
                      Severity: Minor
                      Found in src/lib/pipeline/m2/index.js - About 1 hr to fix

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

                          connect(host, port = NaN) {
                            if (!this.connected) {
                              this.host = host;
                              this.port = port;
                              this.uri = 'ws://' + this.host + ':' + this.port;
                        Severity: Minor
                        Found in src/lib/net/socket.js - About 1 hr to fix

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

                            animate(delta, camera, cameraMoved) {
                              for (const wmoDoodad of this.animatedDoodads.values()) {
                                if (!wmoDoodad.visible) {
                                  continue;
                                }
                          Severity: Minor
                          Found in src/lib/game/world/wmo-manager/wmo-handler.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 dataReceived has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            dataReceived(_socket) {
                              while (true) {
                                if (!this.connected) {
                                  return;
                                }
                          Severity: Minor
                          Found in src/lib/game/handler.js - About 1 hr to fix

                            Function registerAnimationTrack has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              registerAnimationTrack(opts) {
                                const trackName = opts.target.uuid + '.' + opts.property;
                                const animationBlock = opts.animationBlock;
                                const { valueTransform } = opts;
                            
                            
                            Severity: Minor
                            Found in src/lib/pipeline/m2/animation-manager.js - About 1 hr to fix

                              Function dbc has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                              Open

                                dbc(req, res) {
                                  const name = req.resourcePath.match(/(\w+)\.dbc/)[1];
                                  const definition = DBC[name];
                                  if (definition) {
                                    const dbc = definition.dbc.decode(new DecodeStream(req.resource.data));
                              Severity: Minor
                              Found in src/lib/server/pipeline/index.js - About 55 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 loadTexture has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                              Open

                                loadTexture(textureDef) {
                                  const wrapS = THREE.RepeatWrapping;
                                  const wrapT = THREE.RepeatWrapping;
                                  const flipY = false;
                              
                              
                              Severity: Minor
                              Found in src/lib/pipeline/m2/material/index.js - About 55 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 constructor has a Cognitive Complexity of 7 (exceeds 5 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 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