BuddhaNexus/buddhanexus-frontend

View on GitHub

Showing 155 of 280 total issues

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

      render() {
        return html`
          <div class="static-page-container">
            <div class="main-border">
              <div class="main-content">
    Severity: Major
    Found in src/views/static/news/news-view.js - About 1 day to fix

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

          render() {
            //prettier-ignore
            return html`
              <div class="static-page-container">
                <div class="main-border">
        Severity: Major
        Found in src/views/static/institutions/institutions-view.js - About 5 hrs to fix

          Function render has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
          Open

            render() {
              if (!this.data) {
                //prettier-ignore
                return html`<span lang="en">Click on a syllable in the Inquiry Text to display the approximate
                    matches. Only colored syllables have parallels. Black text has no
          Severity: Minor
          Found in src/views/textview/text-view-middle.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 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

          File data-view.js has 385 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /**
           * @file data-view is the container component of table-view, numbers-view, table-view and graph-view.
           *
           * @todo:
           * - pass filter values inside an object instead of separately in order to simplify code.
          Severity: Minor
          Found in src/views/data/data-view.js - About 5 hrs to fix

            Function render has 130 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              render() {
                return html`
                  <div class="static-page-container">
                    <div class="main-border">
                      <div class="main-content">
            Severity: Major
            Found in src/views/static/guidelines/guidelines-view.js - About 5 hrs to fix

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

                  highlightParallel({
                    rootSegments,
                    rootOffsetBegin,
                    rootOffsetEnd,
                    rightMode,
                Severity: Minor
                Found in src/views/textview/text-view.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

                File text-view-right.js has 370 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import { customElement, html, LitElement, property } from 'lit-element';
                
                import { findColorValues, highlightActiveMainElement } from './textViewUtils';
                import {
                  getLanguageFromFilename,
                Severity: Minor
                Found in src/views/textview/text-view-right.js - About 4 hrs to fix

                  Function render has 110 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    render() {
                      if (!this.data) {
                        //prettier-ignore
                        return html`<span lang="en">Click on a syllable in the Inquiry Text to display the approximate
                            matches. Only colored syllables have parallels. Black text has no
                  Severity: Major
                  Found in src/views/textview/text-view-middle.js - About 4 hrs to fix

                    DataView has 34 functions (exceeds 20 allowed). Consider refactoring.
                    Open

                    @customElement('data-view')
                    export class DataView extends LitElement {
                      @property({ type: String }) fileName = '';
                      @property({ type: String }) language;
                      @property({ type: Number }) score;
                    Severity: Minor
                    Found in src/views/data/data-view.js - About 4 hrs to fix

                      Function render has 106 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        render() {
                          const shouldShowTextSearchBox =
                            (this.viewMode === DATA_VIEW_MODES.TEXT ||
                              this.viewMode === DATA_VIEW_MODES.TEXT_SEARCH) &&
                            this.fileName;
                      Severity: Major
                      Found in src/views/data/data-view-header-fields.js - About 4 hrs to fix

                        File actions.js has 341 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        import {
                          API_URL,
                          getFileSegmentsUrl,
                          getGraphDataUrl,
                          getTableViewUrl,
                        Severity: Minor
                        Found in src/api/actions.js - About 4 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
                            Severity
                            Category
                            Status
                            Source
                            Language