BuddhaNexus/buddhanexus-frontend

View on GitHub

Showing 155 of 280 total issues

Function LeftSegmentContainer has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

export function LeftSegmentContainer({
  segmentNr,
  segText,
  current_parallels,
  number,
Severity: Minor
Found in src/views/textview/LeftSegment.js - About 45 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

        Function adjustChartHeight has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

          adjustChartHeight() {
            this.chartHeight = '84vh';
            if (!this.graphData || !this.graphData[this.currentPage]) {
              return;
            }
        Severity: Minor
        Found in src/views/visual/visual-view-graph.js - About 45 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 (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

                      if (position > rootOffsetEnd) {
                        word.classList.remove(C_HIGHLIGHTED_SEGMENT);
                      } else {
                        word.classList.add(C_HIGHLIGHTED_SEGMENT);
                      }
          Severity: Major
          Found in src/views/textview/text-view.js - About 45 mins to fix

            Function scrollAfterEndlessReload has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

              scrollAfterEndlessReload() {
                if (this.noScrolling && this.EndlessScrollFlag) {
                  if (this.activeSegment) {
                    let mainScrollPosition = this.scrollTop;
                    let mainElement = document.querySelector('html');
            Severity: Minor
            Found in src/views/textview/text-view-right.js - About 45 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 (position < parallels[i].root_offset_end) {
                        colourValues[j] += 1;
                      }
            Severity: Major
            Found in src/views/textview/textViewUtils.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

                    Function fetchDataText has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                      async fetchDataText() {
                        if (!this.rightFileName) {
                          this.fetchLoading = false;
                          return;
                        }
                    Severity: Minor
                    Found in src/views/textview/text-view-right.js - About 45 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 (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 firstUpdated has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                        firstUpdated(_changedProperties) {
                          super.firstUpdated(_changedProperties);
                          const currentUrl = window.location.href;
                          if (currentUrl.match('/chn/text/[TX][0-9]+$')) {
                            let textNr = currentUrl.match(/[TX][0-9]+$/g)[0];
                      Severity: Minor
                      Found in src/index.js - About 45 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 collectionMenu has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                        collectionMenu() {
                          if (!this.navigationMenuData) {
                            return;
                          }
                          let collectionMenuData = html``;
                      Severity: Minor
                      Found in src/views/menus/navigation-menu.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 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 TibetanSegmentUnicode has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                      const TibetanSegmentUnicode = segment => {
                        let strippedSegment = segment.replace(/ \//g, '/');
                        strippedSegment = strippedSegment.replace(/ng\//g, 'ng /'); // always put tsek between nga and shad
                        if (strippedSegment.match(/@|#/)) {
                          // don't process folio numbers
                      Severity: Minor
                      Found in src/views/textview/TextSegment.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

                      Avoid too many return statements within this function.
                      Open

                            return 'Facsimile';
                      Severity: Major
                      Found in src/views/data/data-view-header-fields.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                return 'PTS Section';
                        Severity: Major
                        Found in src/views/data/data-view-header-fields.js - About 30 mins to fix
                          Severity
                          Category
                          Status
                          Source
                          Language