wowserhq/wowser

View on GitHub

Showing 114 of 114 total issues

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

          <form onSubmit={ this._onSubmit }>
            <fieldset>
              <select value={ this.state.realm }
                      onChange={ this._onRealmSelect }>
                { this.state.realms.map((realm) => {
Severity: Major
Found in src/components/realms/index.jsx and 1 other location - About 1 day to fix
src/components/characters/index.jsx on lines 75..93

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

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

          <form onSubmit={ this._onSubmit }>
            <fieldset>
              <select value={ this.state.character }
                      onChange={ this._onCharacterSelect }>
                { this.state.characters.map((character) => {
Severity: Major
Found in src/components/characters/index.jsx and 1 other location - About 1 day to fix
src/components/realms/index.jsx on lines 71..89

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

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() {
    super();

    this.state = {
      realm: null,
Severity: Major
Found in src/components/realms/index.jsx and 1 other location - About 6 hrs to fix
src/components/characters/index.jsx on lines 10..27

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

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() {
    super();

    this.state = {
      character: null,
Severity: Major
Found in src/components/characters/index.jsx and 1 other location - About 6 hrs to fix
src/components/realms/index.jsx on lines 10..27

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

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

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

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

      loadSequence(sequenceIndex) {
        // The sequence is already loaded.
        if (typeof this.loadedSequences[sequenceIndex] !== 'undefined') {
          return this.loadedSequences[sequenceIndex];
        }
    Severity: Major
    Found in src/lib/pipeline/m2/animation-manager.js and 1 other location - About 3 hrs to fix
    src/lib/pipeline/m2/animation-manager.js on lines 38..50

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

    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

      loadAnimation(animationIndex) {
        // The animation is already loaded.
        if (typeof this.loadedAnimations[animationIndex] !== 'undefined') {
          return this.loadedAnimations[animationIndex];
        }
    Severity: Major
    Found in src/lib/pipeline/m2/animation-manager.js and 1 other location - About 3 hrs to fix
    src/lib/pipeline/m2/animation-manager.js on lines 81..93

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

    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

    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

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

          resolveTextureIndices(data, batchData) {
            batchData.textureIndices = [];
        
            for (let opIndex = 0; opIndex < batchData.opCount; opIndex++) {
              const textureIndex = data.textureLookups[batchData.textureLookup + opIndex];
        Severity: Major
        Found in src/lib/pipeline/m2/batch-manager.js and 1 other location - About 2 hrs to fix
        src/lib/pipeline/m2/batch-manager.js on lines 105..112

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

        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

          resolveUVAnimationIndices(data, batchData) {
            batchData.uvAnimationIndices = [];
        
            for (let opIndex = 0; opIndex < batchData.opCount; opIndex++) {
              const uvAnimationIndex = data.uvAnimationLookups[batchData.uvAnimationLookup + opIndex];
        Severity: Major
        Found in src/lib/pipeline/m2/batch-manager.js and 1 other location - About 2 hrs to fix
        src/lib/pipeline/m2/batch-manager.js on lines 96..103

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

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

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

                if (this.chunkRefs.has(entry.id)) {
                  chunkRefs = this.chunkRefs.get(entry.id);
                } else {
                  chunkRefs = new Set();
                  this.chunkRefs.set(entry.id, chunkRefs);
          Severity: Major
          Found in src/lib/game/world/doodad-manager.js and 1 other location - About 2 hrs to fix
          src/lib/game/world/wmo-manager/index.js on lines 71..76

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

          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

              if (this.chunkRefs.has(wmoEntry.id)) {
                chunkRefs = this.chunkRefs.get(wmoEntry.id);
              } else {
                chunkRefs = new Set();
                this.chunkRefs.set(wmoEntry.id, chunkRefs);
          Severity: Major
          Found in src/lib/game/world/wmo-manager/index.js and 1 other location - About 2 hrs to fix
          src/lib/game/world/doodad-manager.js on lines 42..47

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

          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

          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

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

                  this.sequenceClips.forEach((clip) => {
                    clip.tracks = clip.tracks.filter((track) => {
                      return track.name !== trackID;
                    });
              
              
              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 144..151

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

              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

                  this.animationClips.forEach((clip) => {
                    clip.tracks = clip.tracks.filter((track) => {
                      return track.name !== trackID;
                    });
              
              
              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 153..160

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

              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