wowserhq/wowser

View on GitHub

Showing 114 of 114 total issues

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 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 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

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

        constructor(session) {
          super();
      
          // Holds session
          this.session = session;
      Severity: Major
      Found in src/lib/characters/handler.js and 1 other location - About 2 hrs to fix
      src/lib/realms/handler.js on lines 10..21

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 80.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

        constructor(session) {
          super();
      
          // Holds session
          this.session = session;
      Severity: Major
      Found in src/lib/realms/handler.js and 1 other location - About 2 hrs to fix
      src/lib/characters/handler.js on lines 10..21

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 80.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      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

        Similar blocks of code found in 3 locations. Consider refactoring.
        Open

        export default function(path) {
          return loader.load(path).then((raw) => {
            const buffer = new Buffer(new Uint8Array(raw));
            const stream = new DecodeStream(buffer);
            const data = WMOGroup.decode(stream);
        Severity: Major
        Found in src/lib/pipeline/wmo/group/loader.js and 2 other locations - About 2 hrs to fix
        src/lib/pipeline/wdt/loader.js on lines 8..15
        src/lib/pipeline/wmo/loader.js on lines 8..15

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 78.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 3 locations. Consider refactoring.
        Open

        export default function(path) {
          return loader.load(path).then((raw) => {
            const buffer = new Buffer(new Uint8Array(raw));
            const stream = new DecodeStream(buffer);
            const data = WMO.decode(stream);
        Severity: Major
        Found in src/lib/pipeline/wmo/loader.js and 2 other locations - About 2 hrs to fix
        src/lib/pipeline/wdt/loader.js on lines 8..15
        src/lib/pipeline/wmo/group/loader.js on lines 8..15

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 78.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 3 locations. Consider refactoring.
        Open

        export default function(path) {
          return loader.load(path).then((raw) => {
            const buffer = new Buffer(new Uint8Array(raw));
            const stream = new DecodeStream(buffer);
            const data = WDT.decode(stream);
        Severity: Major
        Found in src/lib/pipeline/wdt/loader.js and 2 other locations - About 2 hrs to fix
        src/lib/pipeline/wmo/group/loader.js on lines 8..15
        src/lib/pipeline/wmo/loader.js on lines 8..15

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 78.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 3 locations. Consider refactoring.
        Open

                <div className="panel headless">
                  <div className="icon portrait"></div>
                  <h1>Headless panel</h1>
                  <div className="divider thick"></div>
                  <p>
        Severity: Major
        Found in src/components/kit/index.jsx and 2 other locations - About 2 hrs to fix
        src/components/game/quests/index.jsx on lines 9..19
        src/components/kit/index.jsx on lines 32..39

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 77.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

          unloadSequence(sequenceIndex) {
            // The sequence isn't loaded.
            if (typeof this.loadedSquences[sequenceIndex] === 'undefined') {
              return;
            }
        Severity: Major
        Found in src/lib/pipeline/m2/animation-manager.js and 1 other location - About 2 hrs to fix
        src/lib/pipeline/m2/animation-manager.js on lines 52..64

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 77.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 3 locations. Consider refactoring.
        Open

                <div className="panel">
                  <div className="icon portrait"></div>
                  <h1>Regular panel</h1>
                  <div className="divider"></div>
                  <p>
        Severity: Major
        Found in src/components/kit/index.jsx and 2 other locations - About 2 hrs to fix
        src/components/game/quests/index.jsx on lines 9..19
        src/components/kit/index.jsx on lines 41..48

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 77.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 3 locations. Consider refactoring.
        Open

              <quests className="quests panel headless">
                <div className="icon portrait"></div>
        
                <h1>Quest Log</h1>
        
        
        Severity: Major
        Found in src/components/game/quests/index.jsx and 2 other locations - About 2 hrs to fix
        src/components/kit/index.jsx on lines 32..39
        src/components/kit/index.jsx on lines 41..48

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 77.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

          unloadAnimation(animationIndex) {
            // The animation isn't loaded.
            if (typeof this.loadedAnimations[animationIndex] === 'undefined') {
              return;
            }
        Severity: Major
        Found in src/lib/pipeline/m2/animation-manager.js and 1 other location - About 2 hrs to fix
        src/lib/pipeline/m2/animation-manager.js on lines 95..106

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 77.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        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

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                      if (!(name in this.cache)) {
                        this.cache[name] = WorkerPool.enqueue('DBC', name).then((args) => {
                          const [data] = args;
                          return new this(data);
                        });
                  Severity: Major
                  Found in src/lib/pipeline/dbc/index.js and 1 other location - About 1 hr to fix
                  src/lib/pipeline/wdt/index.js on lines 12..17

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 71.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Severity
                  Category
                  Status
                  Source
                  Language