Showing 1,553 of 1,553 total issues

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

        const scale =
          dist *
          (order % 2 === 0
            ? (((j / 2) | 0) + 0.5) * (1 - 2 * (j % 2))
            : (((j + 1) / 2) | 0) * (-1 + 2 * (j % 2)))
Severity: Major
Found in packages/miew/src/gfx/modes/groups/BondsCylinderGroup.js and 1 other location - About 2 hrs to fix
packages/miew/src/gfx/modes/groups/BondsCylinderGroup.js on lines 96..100

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

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

      case 107:
        event.preventDefault()
        event.stopPropagation()
        this._forEachComplexVisual((visual) => {
          visual.expandSelection()
Severity: Major
Found in packages/miew/src/Miew.ts and 1 other location - About 2 hrs to fix
packages/miew/src/Miew.ts on lines 3176..3185

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

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

      case 109:
        event.preventDefault()
        event.stopPropagation()
        this._forEachComplexVisual((visual) => {
          visual.shrinkSelection()
Severity: Major
Found in packages/miew/src/Miew.ts and 1 other location - About 2 hrs to fix
packages/miew/src/Miew.ts on lines 3166..3175

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

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

      test_match: function test_match(match, indexed_rule) {
        var token, lines, backup;
        if (this.options.backtrack_lexer) {
          backup = {
            yylineno: this.yylineno,
Severity: Major
Found in packages/miew-cli/dist/index.modern.js - About 2 hrs to fix

    Function getMiewWithCli has 59 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    var getMiewWithCli = function getMiewWithCli(miewInstance) {
      var obj = Object.create(miewInstance);
      obj.script = function (script, _printCallback, _errorCallback) {
        MiewCLIParser.parser.yy.miew = obj;
        MiewCLIParser.parser.yy.echo = _printCallback;
    Severity: Major
    Found in packages/miew-cli/dist/index.modern.js - About 2 hrs to fix

      Function Menu has 59 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function Menu(/** Node */ container, /** Miew */ viewer) {
        // Add proper DOM elements
        _.forEach($.parseHTML(menuHtml), (element) =>
          container.parentNode.appendChild(element)
        )
      Severity: Major
      Found in demo/src/scripts/ui/Menu.js - About 2 hrs to fix

        Function getMiewWithCli has 59 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        var getMiewWithCli = function getMiewWithCli(miewInstance) {
          var obj = Object.create(miewInstance);
          obj.script = function (script, _printCallback, _errorCallback) {
            MiewCLIParser.parser.yy.miew = obj;
            MiewCLIParser.parser.yy.echo = _printCallback;
        Severity: Major
        Found in packages/miew-cli/dist/index.js - About 2 hrs to fix

          Function test_match has 59 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                test_match: function test_match(match, indexed_rule) {
                  var token, lines, backup;
                  if (this.options.backtrack_lexer) {
                    backup = {
                      yylineno: this.yylineno,
          Severity: Major
          Found in packages/miew-cli/dist/index.js - About 2 hrs to fix

            Function _renderFrame has 59 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              _renderFrame(stereo) {
                const gfx = this._gfx
                const { renderer } = gfx
            
                renderer.getSize(this._size)
            Severity: Major
            Found in packages/miew/src/Miew.ts - About 2 hrs to fix

              Function _parseAssemblyInfo has 59 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                _parseAssemblyInfo(mmtfData) {
                  let i
                  let j
                  let k
                  const assemblies = []
              Severity: Major
              Found in packages/miew/src/io/parsers/MMTFParser.js - About 2 hrs to fix

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

                  {
                    id: 'PL',
                    name: 'Glossy Plastic',
                    shortName: 'Glossy',
                    uberOptions: {
                Severity: Major
                Found in packages/miew/src/gfx/materials.js and 7 other locations - About 2 hrs to fix
                packages/miew/src/gfx/materials.js on lines 9..26
                packages/miew/src/gfx/materials.js on lines 27..44
                packages/miew/src/gfx/materials.js on lines 63..80
                packages/miew/src/gfx/materials.js on lines 81..98
                packages/miew/src/gfx/materials.js on lines 99..116
                packages/miew/src/gfx/materials.js on lines 117..134
                packages/miew/src/gfx/materials.js on lines 135..152

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

                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

                          const onLogMessage = function (e) {
                            const msg = e.message.replaceAll('[', '(').replaceAll(']', ')') // temp workaround for https://github.com/jcubic/jquery.terminal/issues/470
                            term.echo(`[[b;${colors[e.level] || '#666'};]${msg}]`)
                          }
                Severity: Major
                Found in demo/src/scripts/ui/Menu.js and 1 other location - About 2 hrs to fix
                packages/miew-app/src/components/menu/terminal/Terminal.jsx on lines 25..28

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

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

                  {
                    id: 'TR',
                    name: 'Transparent',
                    shortName: 'Transparent',
                    uberOptions: {
                Severity: Major
                Found in packages/miew/src/gfx/materials.js and 7 other locations - About 2 hrs to fix
                packages/miew/src/gfx/materials.js on lines 9..26
                packages/miew/src/gfx/materials.js on lines 27..44
                packages/miew/src/gfx/materials.js on lines 45..62
                packages/miew/src/gfx/materials.js on lines 63..80
                packages/miew/src/gfx/materials.js on lines 99..116
                packages/miew/src/gfx/materials.js on lines 117..134
                packages/miew/src/gfx/materials.js on lines 135..152

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

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

                  {
                    id: 'SF',
                    name: 'Soft Plastic',
                    shortName: 'Soft',
                    uberOptions: {
                Severity: Major
                Found in packages/miew/src/gfx/materials.js and 7 other locations - About 2 hrs to fix
                packages/miew/src/gfx/materials.js on lines 9..26
                packages/miew/src/gfx/materials.js on lines 45..62
                packages/miew/src/gfx/materials.js on lines 63..80
                packages/miew/src/gfx/materials.js on lines 81..98
                packages/miew/src/gfx/materials.js on lines 99..116
                packages/miew/src/gfx/materials.js on lines 117..134
                packages/miew/src/gfx/materials.js on lines 135..152

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

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

                  {
                    id: 'ME',
                    name: 'Metal',
                    shortName: 'Metal',
                    uberOptions: {
                Severity: Major
                Found in packages/miew/src/gfx/materials.js and 7 other locations - About 2 hrs to fix
                packages/miew/src/gfx/materials.js on lines 9..26
                packages/miew/src/gfx/materials.js on lines 27..44
                packages/miew/src/gfx/materials.js on lines 45..62
                packages/miew/src/gfx/materials.js on lines 81..98
                packages/miew/src/gfx/materials.js on lines 99..116
                packages/miew/src/gfx/materials.js on lines 117..134
                packages/miew/src/gfx/materials.js on lines 135..152

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

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

                  {
                    id: 'BA',
                    name: 'Backdrop',
                    shortName: 'Backdrop',
                    uberOptions: {
                Severity: Major
                Found in packages/miew/src/gfx/materials.js and 7 other locations - About 2 hrs to fix
                packages/miew/src/gfx/materials.js on lines 9..26
                packages/miew/src/gfx/materials.js on lines 27..44
                packages/miew/src/gfx/materials.js on lines 45..62
                packages/miew/src/gfx/materials.js on lines 63..80
                packages/miew/src/gfx/materials.js on lines 81..98
                packages/miew/src/gfx/materials.js on lines 99..116
                packages/miew/src/gfx/materials.js on lines 135..152

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

                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

                    lodash.forIn(obj, function (value, key) {
                      var newPref = prefix + (prefix.length > 0 ? '.' : '');
                      if (value instanceof Object) {
                        iterateThrough(value, newPref + key);
                      } else if (value !== undefined) {
                Severity: Major
                Found in packages/miew-cli/dist/index.js and 1 other location - About 2 hrs to fix
                packages/miew-cli/dist/index.modern.js on lines 3507..3514

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

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

                  {
                    id: 'DF',
                    name: 'Diffuse',
                    shortName: 'Diffuse',
                    uberOptions: {
                Severity: Major
                Found in packages/miew/src/gfx/materials.js and 7 other locations - About 2 hrs to fix
                packages/miew/src/gfx/materials.js on lines 27..44
                packages/miew/src/gfx/materials.js on lines 45..62
                packages/miew/src/gfx/materials.js on lines 63..80
                packages/miew/src/gfx/materials.js on lines 81..98
                packages/miew/src/gfx/materials.js on lines 99..116
                packages/miew/src/gfx/materials.js on lines 117..134
                packages/miew/src/gfx/materials.js on lines 135..152

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

                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

                    forIn(obj, function (value, key) {
                      var newPref = prefix + (prefix.length > 0 ? '.' : '');
                      if (value instanceof Object) {
                        iterateThrough(value, newPref + key);
                      } else if (value !== undefined) {
                Severity: Major
                Found in packages/miew-cli/dist/index.modern.js and 1 other location - About 2 hrs to fix
                packages/miew-cli/dist/index.js on lines 3511..3518

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

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

                  {
                    id: 'GL',
                    name: 'Glass',
                    shortName: 'Glass',
                    uberOptions: {
                Severity: Major
                Found in packages/miew/src/gfx/materials.js and 7 other locations - About 2 hrs to fix
                packages/miew/src/gfx/materials.js on lines 9..26
                packages/miew/src/gfx/materials.js on lines 27..44
                packages/miew/src/gfx/materials.js on lines 45..62
                packages/miew/src/gfx/materials.js on lines 63..80
                packages/miew/src/gfx/materials.js on lines 81..98
                packages/miew/src/gfx/materials.js on lines 117..134
                packages/miew/src/gfx/materials.js on lines 135..152

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

                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