packages/miew/src/utils/SelectionParser.js

Summary

Maintainability
F
1 mo
Test Coverage

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

Function parser has 782 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/src/utils/SelectionParser.js - About 3 days to fix

    Function lexer has 405 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      var lexer = (function () {
        var lexer = {
          EOF: 1,
    
          parseError: function parseError(str, hash) {
    Severity: Major
    Found in packages/miew/src/utils/SelectionParser.js - About 2 days to fix

      File SelectionParser.js has 785 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/src/utils/SelectionParser.js - About 1 day to fix

        Function parse has 182 lines of code (exceeds 25 allowed). 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 - About 7 hrs to fix

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

                test_match: function (match, indexed_rule) {
                  var token, lines, backup
          
                  if (this.options.backtrack_lexer) {
                    // save context
          Severity: Major
          Found in packages/miew/src/utils/SelectionParser.js - About 2 hrs to fix

            Function anonymous has 65 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                  performAction: function anonymous(
                    yy,
                    yy_,
                    $avoiding_name_collisions,
                    YY_START
            Severity: Major
            Found in packages/miew/src/utils/SelectionParser.js - About 2 hrs to fix

              Function next has 54 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                    next: function () {
                      if (this.done) {
                        return this.EOF
                      }
                      if (!this._input) {
              Severity: Major
              Found in packages/miew/src/utils/SelectionParser.js - About 2 hrs to fix

                Function anonymous has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    performAction: function anonymous(
                      yytext,
                      yyleng,
                      yylineno,
                      yy,
                Severity: Minor
                Found in packages/miew/src/utils/SelectionParser.js - About 1 hr to fix

                  Function unput has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                        unput: function (ch) {
                          var len = ch.length
                          var lines = ch.split(/(?:\r\n?|\n)/g)
                  
                          this._input = ch + this._input
                  Severity: Minor
                  Found in packages/miew/src/utils/SelectionParser.js - About 1 hr to fix

                    Function performAction has 7 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                          yytext,
                          yyleng,
                          yylineno,
                          yy,
                          yystate /* action[1] */,
                    Severity: Major
                    Found in packages/miew/src/utils/SelectionParser.js - About 50 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 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 false
                          Severity: Major
                          Found in packages/miew/src/utils/SelectionParser.js - About 30 mins 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/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

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

                                  test_match: function (match, indexed_rule) {
                                    var token, lines, backup
                            
                                    if (this.options.backtrack_lexer) {
                                      // save context
                            Severity: Major
                            Found in packages/miew/src/utils/SelectionParser.js and 1 other location - About 4 days to fix
                            packages/miew-cli/src/MiewCLIParser.js on lines 2605..2679

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

                            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

                                  unput: function (ch) {
                                    var len = ch.length
                                    var lines = ch.split(/(?:\r\n?|\n)/g)
                            
                                    this._input = ch + this._input
                            Severity: Major
                            Found in packages/miew/src/utils/SelectionParser.js and 1 other location - About 2 days to fix
                            packages/miew-cli/src/MiewCLIParser.js on lines 2506..2541

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

                            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

                                  next: function () {
                                    if (this.done) {
                                      return this.EOF
                                    }
                                    if (!this._input) {
                            Severity: Major
                            Found in packages/miew/src/utils/SelectionParser.js and 1 other location - About 2 days to fix
                            packages/miew-cli/src/MiewCLIParser.js on lines 2682..2740

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

                            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

                                  setInput: function (input, yy) {
                                    this.yy = yy || this.yy || {}
                                    this._input = input
                                    this._more = this._backtrack = this.done = false
                                    this.yylineno = this.yyleng = 0
                            Severity: Major
                            Found in packages/miew/src/utils/SelectionParser.js and 1 other location - About 1 day to fix
                            packages/miew-cli/src/MiewCLIParser.js on lines 2462..2480

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

                            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

                                  input: function () {
                                    var ch = this._input[0]
                                    this.yytext += ch
                                    this.yyleng++
                                    this.offset++
                            Severity: Major
                            Found in packages/miew/src/utils/SelectionParser.js and 1 other location - About 1 day to fix
                            packages/miew-cli/src/MiewCLIParser.js on lines 2483..2503

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

                            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

                                  _currentRules: function _currentRules() {
                                    if (
                                      this.conditionStack.length &&
                                      this.conditionStack[this.conditionStack.length - 1]
                                    ) {
                            Severity: Major
                            Found in packages/miew/src/utils/SelectionParser.js and 1 other location - About 3 hrs to fix
                            packages/miew-cli/src/MiewCLIParser.js on lines 2768..2779

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

                            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

                                  upcomingInput: function () {
                                    var next = this.match
                                    if (next.length < 20) {
                                      next += this._input.substr(0, 20 - next.length)
                                    }
                            Severity: Major
                            Found in packages/miew/src/utils/SelectionParser.js and 1 other location - About 3 hrs to fix
                            packages/miew-cli/src/MiewCLIParser.js on lines 2586..2595

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

                            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

                                  reject: function () {
                                    if (this.options.backtrack_lexer) {
                                      this._backtrack = true
                                    } else {
                                      return this.parseError(
                            Severity: Major
                            Found in packages/miew/src/utils/SelectionParser.js and 1 other location - About 3 hrs to fix
                            packages/miew-cli/src/MiewCLIParser.js on lines 2550..2567

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

                            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

                                  pastInput: function () {
                                    var past = this.matched.substr(
                                      0,
                                      this.matched.length - this.match.length
                                    )
                            Severity: Major
                            Found in packages/miew/src/utils/SelectionParser.js and 1 other location - About 2 hrs to fix
                            packages/miew-cli/src/MiewCLIParser.js on lines 2575..2583

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

                            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

                                  showPosition: function () {
                                    var pre = this.pastInput()
                                    var c = new Array(pre.length + 1).join('-')
                                    return pre + this.upcomingInput() + '\n' + c + '^'
                                  },
                            Severity: Major
                            Found in packages/miew/src/utils/SelectionParser.js and 1 other location - About 2 hrs to fix
                            packages/miew-cli/src/MiewCLIParser.js on lines 2598..2602

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

                            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

                                  topState: function topState(n) {
                                    n = this.conditionStack.length - 1 - Math.abs(n || 0)
                                    if (n >= 0) {
                                      return this.conditionStack[n]
                                    } else {
                            Severity: Major
                            Found in packages/miew/src/utils/SelectionParser.js and 1 other location - About 2 hrs to fix
                            packages/miew-cli/src/MiewCLIParser.js on lines 2782..2789

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

                            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

                                  popState: function popState() {
                                    var n = this.conditionStack.length - 1
                                    if (n > 0) {
                                      return this.conditionStack.pop()
                                    } else {
                            Severity: Major
                            Found in packages/miew/src/utils/SelectionParser.js and 1 other location - About 1 hr to fix
                            packages/miew-cli/src/MiewCLIParser.js on lines 2758..2765

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

                            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

                              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/src/utils/SelectionParser.js and 1 other location - About 1 hr to fix
                            packages/miew-cli/src/MiewCLIParser.js on lines 77..80

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

                            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

                                  lex: function lex() {
                                    var r = this.next()
                                    if (r) {
                                      return r
                                    } else {
                            Severity: Minor
                            Found in packages/miew/src/utils/SelectionParser.js and 1 other location - About 50 mins to fix
                            packages/miew-cli/src/MiewCLIParser.js on lines 2743..2750

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

                            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

                            There are no issues that match your filters.

                            Category
                            Status