Showing 1,553 of 1,553 total issues

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

var parser = function () {
  var o = function o(k, v, _o, l) {
    for (_o = _o || {}, l = k.length; l--; _o[k[l]] = v) {
    }
    return _o;
Severity: Major
Found in packages/miew-cli/dist/index.js and 1 other location - About 4 mos to fix
packages/miew-cli/dist/index.modern.js on lines 70..2707

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

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

var parser = function () {
  var o = function o(k, v, _o, l) {
    for (_o = _o || {}, l = k.length; l--; _o[k[l]] = v) {
    }
    return _o;
Severity: Major
Found in packages/miew-cli/dist/index.modern.js and 1 other location - About 4 mos to fix
packages/miew-cli/dist/index.js on lines 74..2711

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

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

Severity: Major
Found in packages/miew/tools/pdbfreq.py and 1 other location - About 2 wks to fix
demo/tools/pdbfreq.py on lines 0..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 1641.

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

Severity: Major
Found in demo/tools/pdbfreq.py and 1 other location - About 2 wks to fix
packages/miew/tools/pdbfreq.py on lines 0..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 1641.

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

var parser = (function () {
  var o = function (k, v, o, l) {
      for (o = o || {}, l = k.length; l--; o[k[l]] = v);
      return o
    },
Severity: Major
Found in packages/miew-cli/src/MiewCLIParser.js - About 2 wks to fix

    Function parser has 2634 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    var parser = function () {
      var o = function o(k, v, _o, l) {
        for (_o = _o || {}, l = k.length; l--; _o[k[l]] = v) {
        }
        return _o;
    Severity: Major
    Found in packages/miew-cli/dist/index.js - About 1 wk to fix

      Function parser has 2634 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      var parser = function () {
        var o = function o(k, v, _o, l) {
          for (_o = _o || {}, l = k.length; l--; _o[k[l]] = v) {
          }
          return _o;
      Severity: Major
      Found in packages/miew-cli/dist/index.modern.js - About 1 wk to fix

        File index.js has 4041 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /** 3D Molecular Viewer v0.0.1
        Copyright (c) 2015-2023 EPAM Systems, Inc. */
        
        'use strict';
        
        
        Severity: Major
        Found in packages/miew-cli/dist/index.js - About 1 wk to fix

          File index.modern.js has 4039 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /** 3D Molecular Viewer v0.0.1
          Copyright (c) 2015-2023 EPAM Systems, Inc. */
          
          import { Miew } from 'miew';
          import { find, forEach, remove, omitBy, findKey, isNumber, assign, forIn, isEmpty, isEqual, isString, isPlainObject, isUndefined, slice, sortBy, keys, get, set } from 'lodash';
          Severity: Major
          Found in packages/miew-cli/dist/index.modern.js - About 1 wk to fix

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

                parse: function parse(input) {
                  var self = this,
                    stack = [0],
                    tstack = [],
                    vstack = [null],
            Severity: Major
            Found in packages/miew-cli/src/MiewCLIParser.js and 1 other location - About 1 wk to fix
            packages/miew/src/utils/SelectionParser.js on lines 265..448

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

            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

                parse: function parse(input) {
                  var self = this,
                    stack = [0],
                    tstack = [],
                    vstack = [null],
            Severity: Major
            Found in packages/miew/src/utils/SelectionParser.js and 1 other location - About 1 wk to fix
            packages/miew-cli/src/MiewCLIParser.js on lines 2262..2445

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

            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 Miew.ts has 3458 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /* global DEBUG:false, PACKAGE_VERSION:false */
            // eslint-disable-next-line
            //@ts-nocheck
            import { Spinner } from 'spin.js'
            import Stats from './gfx/Stats'
            Severity: Major
            Found in packages/miew/src/Miew.ts - About 1 wk to fix

              File MiewCLIParser.js has 3029 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              /* eslint-disable */
              // DO NOT EDIT! Automatically generated from .jison
              /* parser generated by jison 0.4.18 */
              /*
                Returns a Parser object of the following structure:
              Severity: Major
              Found in packages/miew-cli/src/MiewCLIParser.js - About 1 wk to fix

                File Menu.js has 2631 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import $ from 'jquery'
                import _ from 'lodash'
                import { Miew } from 'miew'
                import menuHtml from '../../menu.html'
                import 'bootstrap'
                Severity: Major
                Found in demo/src/scripts/ui/Menu.js - About 1 wk to fix

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

                  describe('utils/logger', () => {
                    describe('.instantiate()', () => {
                      it('creates different instance', () => {
                        expect(logger.instantiate()).to.not.equal(logger)
                      })
                  Severity: Major
                  Found in packages/miew/src/utils/logger.test.js and 1 other location - About 6 days to fix
                  packages/miew-cli/src/logger.test.js on lines 10..117

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

                  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

                  describe('utils/logger', () => {
                    describe('.instantiate()', () => {
                      it('creates different instance', () => {
                        expect(logger.instantiate()).to.not.equal(logger)
                      })
                  Severity: Major
                  Found in packages/miew-cli/src/logger.test.js and 1 other location - About 6 days to fix
                  packages/miew/src/utils/logger.test.js on lines 10..117

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

                  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

                  Severity: Major
                  Found in packages/miew/tools/atom_types.py and 1 other location - About 5 days to fix
                  demo/tools/atom_types.py on lines 0..72

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

                  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

                  Severity: Major
                  Found in demo/tools/atom_types.py and 1 other location - About 5 days to fix
                  packages/miew/tools/atom_types.py on lines 0..72

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

                  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 parser has a Cognitive Complexity of 231 (exceeds 5 allowed). Consider refactoring.
                  Open

                  var parser = (function () {
                    var o = function (k, v, o, l) {
                        for (o = o || {}, l = k.length; l--; o[k[l]] = v);
                        return o
                      },
                  Severity: Minor
                  Found in packages/miew-cli/src/MiewCLIParser.js - About 4 days 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 parser has a Cognitive Complexity of 224 (exceeds 5 allowed). Consider refactoring.
                  Open

                  var parser = (function () {
                    var o = function (k, v, o, l) {
                        for (o = o || {}, l = k.length; l--; o[k[l]] = v);
                        return o
                      },
                  Severity: Minor
                  Found in packages/miew/src/utils/SelectionParser.js - About 4 days to fix

                  Cognitive Complexity

                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                  A method's cognitive complexity is based on a few simple rules:

                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                  • Code is considered more complex for each "break in the linear flow of the code"
                  • Code is considered more complex when "flow breaking structures are nested"

                  Further reading

                  Severity
                  Category
                  Status
                  Source
                  Language