Showing 1,553 of 1,553 total issues

Avoid too many return statements within this function.
Open

          return false
Severity: Major
Found in packages/miew/src/utils/SelectionParser.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

        return val
    Severity: Major
    Found in packages/miew/src/io/parsers/readCIF.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                return this.EOF
      Severity: Major
      Found in packages/miew/src/utils/SelectionParser.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                  return false
        Severity: Major
        Found in packages/miew/src/options.test.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                    return this.parseError(
                      'Lexical error on line ' +
                        (this.yylineno + 1) +
                        '. Unrecognized text.\n' +
                        this.showPosition(),
          Severity: Major
          Found in packages/miew/src/utils/SelectionParser.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                  return true
            Severity: Major
            Found in packages/miew/src/options.test.js - About 30 mins to fix

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

              class OutOfMemoryError extends Error {
                constructor(message) {
                  super()
                  this.name = 'OutOfMemoryError'
                  this.message = message
              Severity: Minor
              Found in packages/miew/src/utils.js and 2 other locations - About 30 mins to fix
              packages/miew-cli/src/utils.js on lines 260..266
              packages/miew/src/io/parsers/CIFParser.js on lines 65..71

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

              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 6 locations. Consider refactoring.
              Open

                static QuickSurfGeo(caps, settings, renderParams) {
                  const gfxTriplet = MeshCreator.createQuickSurface(
                    caps,
                    settings,
                    renderParams
              Severity: Major
              Found in packages/miew/src/gfx/modes/groups/GroupsFactory.js and 5 other locations - About 30 mins to fix
              packages/miew/src/gfx/modes/groups/GroupsFactory.js on lines 27..35
              packages/miew/src/gfx/modes/groups/GroupsFactory.js on lines 43..47
              packages/miew/src/gfx/modes/groups/GroupsFactory.js on lines 95..107
              packages/miew/src/gfx/modes/groups/GroupsFactory.js on lines 119..127
              packages/miew/src/gfx/modes/groups/GroupsFactory.js on lines 129..133

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

              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

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

                    if (!Number.isNaN(value)) {
                      this.props.viewer.set(this.props.prefName, value)
                    }
              Severity: Minor
              Found in examples/miew_via_react/controls/Checkbox.js and 1 other location - About 30 mins to fix
              examples/miew_via_react/controls/SpeedButton.js on lines 12..14

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

              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 6 locations. Consider refactoring.
              Open

                  zRange.x = Math.min(Math.max(zRange.x, 0), this._count.z - 1)
              Severity: Major
              Found in packages/miew/src/chem/VoxelWorld.js and 5 other locations - About 30 mins to fix
              packages/miew/src/chem/VoxelWorld.js on lines 285..285
              packages/miew/src/chem/VoxelWorld.js on lines 286..286
              packages/miew/src/chem/VoxelWorld.js on lines 290..290
              packages/miew/src/chem/VoxelWorld.js on lines 291..291
              packages/miew/src/chem/VoxelWorld.js on lines 296..296

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

              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 6 locations. Consider refactoring.
              Open

                static BondsLines(caps, settings, renderParams) {
                  const gfxTriplet = MeshCreator.create2CLines(caps, settings, renderParams)
              
                  return _bakeGroup(gfxTriplet, processors.Bonds, groups.BondsLinesGroup)
                }
              Severity: Major
              Found in packages/miew/src/gfx/modes/groups/GroupsFactory.js and 5 other locations - About 30 mins to fix
              packages/miew/src/gfx/modes/groups/GroupsFactory.js on lines 27..35
              packages/miew/src/gfx/modes/groups/GroupsFactory.js on lines 95..107
              packages/miew/src/gfx/modes/groups/GroupsFactory.js on lines 109..117
              packages/miew/src/gfx/modes/groups/GroupsFactory.js on lines 119..127
              packages/miew/src/gfx/modes/groups/GroupsFactory.js on lines 129..133

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

              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

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

                }, {
                  key: "joinHelpStr",
                  value: function joinHelpStr(helpData) {
                    if (helpData instanceof Array) {
                      return helpData.join('\n');
              Severity: Minor
              Found in packages/miew-cli/dist/index.modern.js and 1 other location - About 30 mins to fix
              packages/miew-cli/dist/index.js on lines 3841..3849

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

              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

              class OutOfMemoryError extends Error {
                constructor(message) {
                  super()
                  this.name = 'OutOfMemoryError'
                  this.message = message
              Severity: Minor
              Found in packages/miew-cli/src/utils.js and 2 other locations - About 30 mins to fix
              packages/miew/src/io/parsers/CIFParser.js on lines 65..71
              packages/miew/src/utils.js on lines 260..266

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

              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 6 locations. Consider refactoring.
              Open

                  zRange.y = Math.min(Math.max(zRange.y, 0), this._count.z - 1)
              Severity: Major
              Found in packages/miew/src/chem/VoxelWorld.js and 5 other locations - About 30 mins to fix
              packages/miew/src/chem/VoxelWorld.js on lines 285..285
              packages/miew/src/chem/VoxelWorld.js on lines 286..286
              packages/miew/src/chem/VoxelWorld.js on lines 290..290
              packages/miew/src/chem/VoxelWorld.js on lines 291..291
              packages/miew/src/chem/VoxelWorld.js on lines 295..295

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

              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 6 locations. Consider refactoring.
              Open

                static ContactSurfaceGeo(caps, settings, renderParams) {
                  const gfxTriplet = MeshCreator.createContactSurface(
                    caps,
                    settings,
                    renderParams
              Severity: Major
              Found in packages/miew/src/gfx/modes/groups/GroupsFactory.js and 5 other locations - About 30 mins to fix
              packages/miew/src/gfx/modes/groups/GroupsFactory.js on lines 27..35
              packages/miew/src/gfx/modes/groups/GroupsFactory.js on lines 43..47
              packages/miew/src/gfx/modes/groups/GroupsFactory.js on lines 95..107
              packages/miew/src/gfx/modes/groups/GroupsFactory.js on lines 109..117
              packages/miew/src/gfx/modes/groups/GroupsFactory.js on lines 129..133

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

              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 6 locations. Consider refactoring.
              Open

                static ALoopsLines(caps, settings, renderParams) {
                  const gfxTriplet = MeshCreator.createChunkedLines(
                    caps,
                    settings,
                    renderParams
              Severity: Major
              Found in packages/miew/src/gfx/modes/groups/GroupsFactory.js and 5 other locations - About 30 mins to fix
              packages/miew/src/gfx/modes/groups/GroupsFactory.js on lines 27..35
              packages/miew/src/gfx/modes/groups/GroupsFactory.js on lines 43..47
              packages/miew/src/gfx/modes/groups/GroupsFactory.js on lines 109..117
              packages/miew/src/gfx/modes/groups/GroupsFactory.js on lines 119..127
              packages/miew/src/gfx/modes/groups/GroupsFactory.js on lines 129..133

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

              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 6 locations. Consider refactoring.
              Open

                  yRange.x = Math.min(Math.max(yRange.x, 0), this._count.y - 1)
              Severity: Major
              Found in packages/miew/src/chem/VoxelWorld.js and 5 other locations - About 30 mins to fix
              packages/miew/src/chem/VoxelWorld.js on lines 285..285
              packages/miew/src/chem/VoxelWorld.js on lines 286..286
              packages/miew/src/chem/VoxelWorld.js on lines 291..291
              packages/miew/src/chem/VoxelWorld.js on lines 295..295
              packages/miew/src/chem/VoxelWorld.js on lines 296..296

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

              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 6 locations. Consider refactoring.
              Open

                  xRange.x = Math.min(Math.max(xRange.x, 0), this._count.x - 1)
              Severity: Major
              Found in packages/miew/src/chem/VoxelWorld.js and 5 other locations - About 30 mins to fix
              packages/miew/src/chem/VoxelWorld.js on lines 286..286
              packages/miew/src/chem/VoxelWorld.js on lines 290..290
              packages/miew/src/chem/VoxelWorld.js on lines 291..291
              packages/miew/src/chem/VoxelWorld.js on lines 295..295
              packages/miew/src/chem/VoxelWorld.js on lines 296..296

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

              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

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

              function Logger() {
                EventDispatcher.call(this);
                this.console = false;
                this._priority = priorities.warn;
              }
              Severity: Minor
              Found in packages/miew-cli/dist/index.js and 1 other location - About 30 mins to fix
              packages/miew-cli/dist/index.modern.js on lines 2963..2967

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

              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 6 locations. Consider refactoring.
              Open

                static OrphanedAtomsCrosses(caps, settings, renderParams) {
                  const gfxTriplet = MeshCreator.createCrosses(caps, settings, renderParams)
              
                  return _bakeGroup(
                    gfxTriplet,
              Severity: Major
              Found in packages/miew/src/gfx/modes/groups/GroupsFactory.js and 5 other locations - About 30 mins to fix
              packages/miew/src/gfx/modes/groups/GroupsFactory.js on lines 43..47
              packages/miew/src/gfx/modes/groups/GroupsFactory.js on lines 95..107
              packages/miew/src/gfx/modes/groups/GroupsFactory.js on lines 109..117
              packages/miew/src/gfx/modes/groups/GroupsFactory.js on lines 119..127
              packages/miew/src/gfx/modes/groups/GroupsFactory.js on lines 129..133

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

              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