BuddhaNexus/buddhanexus-frontend

View on GitHub
src/views/utility/tibetan-transliteration.js

Summary

Maintainability
F
2 wks
Test Coverage

File tibetan-transliteration.js has 1789 lines of code (exceeds 250 allowed). Consider refactoring.
Open

function newHashSet() {
  var x = [];
  x.add = function(K) {
    if (this.indexOf(K) < 0) this.push(K);
  };
Severity: Major
Found in src/views/utility/tibetan-transliteration.js - About 4 days to fix

    Function fromWylieOneStack has a Cognitive Complexity of 121 (exceeds 5 allowed). Consider refactoring.
    Open

    function fromWylieOneStack(tokens, i, opts) {
      var orig_i = i;
      var t = '',
        t2 = ''; //, o = ''
      var out = '';
    Severity: Minor
    Found in src/views/utility/tibetan-transliteration.js - About 2 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 fromWylie has a Cognitive Complexity of 92 (exceeds 5 allowed). Consider refactoring.
    Open

    export function fromWylie(str, opts, warns) {
      if (!warns) {
        warns = [];
      }
      if (!opts) {
    Severity: Minor
    Found in src/views/utility/tibetan-transliteration.js - About 1 day 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 toWylie has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring.
    Open

    export function toWylie(str, escape, warns) {
      if (!warns) {
        warns = [];
      }
      if (escape === undefined) escape = true;
    Severity: Minor
    Found in src/views/utility/tibetan-transliteration.js - About 1 day 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 fromWylieOneTsekbar has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
    Open

    function fromWylieOneTsekbar(tokens, i, opts) {
      // (str, int)
      var orig_i = i;
      var t = tokens[i];
      // variables for tracking the state within the syllable as we parse it
    Severity: Minor
    Found in src/views/utility/tibetan-transliteration.js - About 1 day 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 fromWylieOneStack has 190 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function fromWylieOneStack(tokens, i, opts) {
      var orig_i = i;
      var t = '',
        t2 = ''; //, o = ''
      var out = '';
    Severity: Major
    Found in src/views/utility/tibetan-transliteration.js - About 7 hrs to fix

      Function toWylieOneStack has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
      Open

      function toWylieOneStack(str, len, i) {
        var orig_i = i;
        var ffinal = null,
          vowel = null,
          klass = null;
      Severity: Minor
      Found in src/views/utility/tibetan-transliteration.js - About 5 hrs to fix

      Cognitive Complexity

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

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

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

      Further reading

      Function fromWylieOneTsekbar has 128 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function fromWylieOneTsekbar(tokens, i, opts) {
        // (str, int)
        var orig_i = i;
        var t = tokens[i];
        // variables for tracking the state within the syllable as we parse it
      Severity: Major
      Found in src/views/utility/tibetan-transliteration.js - About 5 hrs to fix

        Function fromWylie has 103 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function fromWylie(str, opts, warns) {
          if (!warns) {
            warns = [];
          }
          if (!opts) {
        Severity: Major
        Found in src/views/utility/tibetan-transliteration.js - About 4 hrs to fix

          Function splitIntoTokens has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
          Open

          var splitIntoTokens = function(str) {
            var tokens = []; // size = str.length + 2
            var i = 0;
            var maxlen = str.length;
            TOKEN: while (i < maxlen) {
          Severity: Minor
          Found in src/views/utility/tibetan-transliteration.js - About 3 hrs to fix

          Cognitive Complexity

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

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

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

          Further reading

          Function toWylie has 87 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export function toWylie(str, escape, warns) {
            if (!warns) {
              warns = [];
            }
            if (escape === undefined) escape = true;
          Severity: Major
          Found in src/views/utility/tibetan-transliteration.js - About 3 hrs to fix

            Function toWylieOneStack has 87 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function toWylieOneStack(str, len, i) {
              var orig_i = i;
              var ffinal = null,
                vowel = null,
                klass = null;
            Severity: Major
            Found in src/views/utility/tibetan-transliteration.js - About 3 hrs to fix

              Function toWylieOneTsekbar has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
              Open

              function toWylieOneTsekbar(str, len, i) {
                var orig_i = i;
                var warns = [];
                var stacks = []; // ArrayList<ToWylieStack>;
                const placeholder = true;
              Severity: Minor
              Found in src/views/utility/tibetan-transliteration.js - About 3 hrs to fix

              Cognitive Complexity

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

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

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

              Further reading

              Function toWylieOneTsekbar has 70 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function toWylieOneTsekbar(str, len, i) {
                var orig_i = i;
                var warns = [];
                var stacks = []; // ArrayList<ToWylieStack>;
                const placeholder = true;
              Severity: Major
              Found in src/views/utility/tibetan-transliteration.js - About 2 hrs to fix

                Function splitIntoTokens has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                var splitIntoTokens = function(str) {
                  var tokens = []; // size = str.length + 2
                  var i = 0;
                  var maxlen = str.length;
                  TOKEN: while (i < maxlen) {
                Severity: Minor
                Found in src/views/utility/tibetan-transliteration.js - About 1 hr to fix

                  Function exportJsEWTS has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function exportJsEWTS(global) {
                    const jsEWTS = {
                      fromWylie: fromWylie,
                      toWylie: toWylie,
                    };
                  Severity: Minor
                  Found in src/views/utility/tibetan-transliteration.js - About 55 mins 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

                  Avoid deeply nested control flow statements.
                  Open

                            if (m_tokens.contains(tr)) {
                              tokens.push(tr);
                              i += len;
                              continue TOKEN;
                            }
                  Severity: Major
                  Found in src/views/utility/tibetan-transliteration.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                        } else if (state == State.SUFF2) {
                          consonants.push(stack.single_consonant);
                          if (isSuff2(stack.single_consonant)) {
                            if (!suff2(stack.single_consonant, prev_cons)) {
                              warns.push(
                    Severity: Major
                    Found in src/views/utility/tibetan-transliteration.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                if (o != null) {
                                  out += o;
                                  continue ESC;
                                }
                      Severity: Major
                      Found in src/views/utility/tibetan-transliteration.js - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                  if (opts.check_strict && !plus) {
                                    var prev = consonantStringBackwards(tokens, i - 1, orig_i);
                                    if (!subscript(t2, prev)) {
                                      prev = prev.replace(/\+/g, '');
                                      warns.push(
                        Severity: Major
                        Found in src/views/utility/tibetan-transliteration.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                    while (tokens[i] != null && tokens[i] == '^') {
                                      caret++;
                                      i++;
                                    }
                          Severity: Major
                          Found in src/views/utility/tibetan-transliteration.js - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                  if (opts.check_strict) {
                                    if (!isSuffix(stack.single_consonant)) {
                                      warns.push(
                                        'Invalid suffix consonant: "' + stack.single_consonant + '".'
                                      );
                            Severity: Major
                            Found in src/views/utility/tibetan-transliteration.js - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                        if (t2 == 'l' && consonants > 1) break;
                              Severity: Major
                              Found in src/views/utility/tibetan-transliteration.js - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                      if (o == '^') {
                                        st.caret = true;
                                      } else {
                                        if (o == 'H') st.visarga = true;
                                        st.finals.push(o);
                                Severity: Major
                                Found in src/views/utility/tibetan-transliteration.js - About 45 mins to fix

                                  Function consonantStringBackwards has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  function consonantStringBackwards(tokens, i, orig_i) {
                                    var out = [];
                                    var t = '';
                                    while (i >= orig_i && tokens[i] != null) {
                                      t = tokens[i--];
                                  Severity: Minor
                                  Found in src/views/utility/tibetan-transliteration.js - About 35 mins 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 handleSpaces has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  function handleSpaces(str, i) {
                                    //return int
                                    var found = 0;
                                    // var orig_i = i;
                                    while (i < str.length && str.charAt(i) == ' ') {
                                  Severity: Minor
                                  Found in src/views/utility/tibetan-transliteration.js - About 25 mins 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 putStackTogether has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  function putStackTogether(st) {
                                    var out = '';
                                    // put the main elements together... stacked with "+" unless it's a regular stack
                                    if (tib_stack(st.cons_str)) {
                                      out += st.stack.join('');
                                  Severity: Minor
                                  Found in src/views/utility/tibetan-transliteration.js - About 25 mins 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 consonantString has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  function consonantString(tokens, i) {
                                    // strings, int
                                    var out = [];
                                    var t = '';
                                    while (tokens[i] != null) {
                                  Severity: Minor
                                  Found in src/views/utility/tibetan-transliteration.js - About 25 mins 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

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

                                    while (i >= orig_i && tokens[i] != null) {
                                      t = tokens[i--];
                                      if (t == '+' || t == '^') continue;
                                      if (consonant(t) == null) break;
                                      out.unshift(t);
                                  Severity: Major
                                  Found in src/views/utility/tibetan-transliteration.js and 1 other location - About 1 hr to fix
                                  src/views/utility/tibetan-transliteration.js on lines 912..917

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

                                  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

                                    while (tokens[i] != null) {
                                      t = tokens[i++];
                                      if (t == '+' || t == '^') continue;
                                      if (consonant(t) == null) break;
                                      out.push(t);
                                  Severity: Major
                                  Found in src/views/utility/tibetan-transliteration.js and 1 other location - About 1 hr to fix
                                  src/views/utility/tibetan-transliteration.js on lines 928..933

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

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

                                  var superscript = function(sup, below) {
                                    var tmpSet = m_superscripts.get(sup);
                                    if (tmpSet == null) return false;
                                    return tmpSet.contains(below);
                                  };
                                  Severity: Major
                                  Found in src/views/utility/tibetan-transliteration.js and 3 other locations - About 50 mins to fix
                                  src/views/utility/tibetan-transliteration.js on lines 1055..1059
                                  src/views/utility/tibetan-transliteration.js on lines 1063..1067
                                  src/views/utility/tibetan-transliteration.js on lines 1074..1078

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

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

                                  var suff2 = function(suff, before) {
                                    var tmpSet = m_suff2.get(suff);
                                    if (tmpSet == null) return false;
                                    return tmpSet.contains(before);
                                  };
                                  Severity: Major
                                  Found in src/views/utility/tibetan-transliteration.js and 3 other locations - About 50 mins to fix
                                  src/views/utility/tibetan-transliteration.js on lines 1047..1051
                                  src/views/utility/tibetan-transliteration.js on lines 1055..1059
                                  src/views/utility/tibetan-transliteration.js on lines 1063..1067

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

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

                                  var subscript = function(sub, above) {
                                    var tmpSet = m_subscripts.get(sub);
                                    if (tmpSet == null) return false;
                                    return tmpSet.contains(above);
                                  };
                                  Severity: Major
                                  Found in src/views/utility/tibetan-transliteration.js and 3 other locations - About 50 mins to fix
                                  src/views/utility/tibetan-transliteration.js on lines 1047..1051
                                  src/views/utility/tibetan-transliteration.js on lines 1063..1067
                                  src/views/utility/tibetan-transliteration.js on lines 1074..1078

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

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

                                  var prefix = function(pref, after) {
                                    var tmpSet = m_prefixes.get(pref);
                                    if (tmpSet == null) return false;
                                    return tmpSet.contains(after);
                                  };
                                  Severity: Major
                                  Found in src/views/utility/tibetan-transliteration.js and 3 other locations - About 50 mins to fix
                                  src/views/utility/tibetan-transliteration.js on lines 1047..1051
                                  src/views/utility/tibetan-transliteration.js on lines 1055..1059
                                  src/views/utility/tibetan-transliteration.js on lines 1074..1078

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

                                  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 WylieTsekbar = function() {
                                    this.uni_string = '';
                                    this.tokens_used = 0;
                                    this.warns = [];
                                    return this;
                                  Severity: Minor
                                  Found in src/views/utility/tibetan-transliteration.js and 1 other location - About 40 mins to fix
                                  src/views/utility/tibetan-transliteration.js on lines 965..970

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

                                  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 ToWylieTsekbar = function() {
                                    this.wylie = '';
                                    this.tokens_used = 0;
                                    this.warns = [];
                                    return this;
                                  Severity: Minor
                                  Found in src/views/utility/tibetan-transliteration.js and 1 other location - About 40 mins to fix
                                  src/views/utility/tibetan-transliteration.js on lines 938..943

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

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

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

                                              if (!subscript(t2, prev)) {
                                                prev = prev.replace(/\+/g, '');
                                                warns.push(
                                                  'Subjoined "' + t2 + '" not expected after "' + prev + '".'
                                                );
                                  Severity: Minor
                                  Found in src/views/utility/tibetan-transliteration.js and 1 other location - About 35 mins to fix
                                  src/views/utility/tibetan-transliteration.js on lines 1340..1349

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

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

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

                                        if (!superscript(t, next)) {
                                          next = next.replace(/\+/g, '');
                                          warns.push(
                                            'Superscript "' +
                                              t +
                                  Severity: Minor
                                  Found in src/views/utility/tibetan-transliteration.js and 1 other location - About 35 mins to fix
                                  src/views/utility/tibetan-transliteration.js on lines 1394..1399

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

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

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

                                      if (t.charAt(0) == '\\' && (t.charAt(1) == 'u' || t.charAt(1) == 'U')) {
                                        o = unicodeEscape(warns, line, t);
                                        if (o != null) {
                                          i++;
                                          out += o;
                                  Severity: Minor
                                  Found in src/views/utility/tibetan-transliteration.js and 1 other location - About 35 mins to fix
                                  src/views/utility/tibetan-transliteration.js on lines 1586..1592

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

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

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

                                          if (t.charAt(0) == '\\' && (t.charAt(1) == 'u' || t.charAt(1) == 'U')) {
                                            o = unicodeEscape(warns, line, t);
                                            if (o != null) {
                                              out += o;
                                              continue ESC;
                                  Severity: Minor
                                  Found in src/views/utility/tibetan-transliteration.js and 1 other location - About 35 mins to fix
                                  src/views/utility/tibetan-transliteration.js on lines 1637..1644

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

                                  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