BuddhaNexus/buddhanexus-frontend

View on GitHub

Showing 155 of 280 total issues

Function highlightTextByOffset has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

export function highlightTextByOffset({
  textArray,
  startoffset,
  endoffset,
  lang,
Severity: Minor
Found in src/views/utility/preprocessing.js - About 4 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

Consider simplifying this complex logical expression.
Open

          if (
            (filter !== 'numbers' ||
              (this.language !== 'tib' &&
                this.language !== 'skt' &&
                this.language !== 'multi')) &&
Severity: Critical
Found in src/views/data/data-view-view-selector.js - About 4 hrs to fix

    Function render has 96 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/history/history-view.js - About 3 hrs to fix

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

        render() {
          //prettier-ignore
          return html`
            <div class="data-view ${this.headerVisibility}" lang="${this.language}" view="${this.viewMode}">
              <div class="data-view__main-container">
      Severity: Major
      Found in src/views/data/data-view.js - About 3 hrs to fix

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

          render() {
            if (
              this.selectedView === DATA_VIEW_MODES.TEXT ||
              this.selectedView === DATA_VIEW_MODES.TEXT_SEARCH
            ) {
        Severity: Major
        Found in src/views/data/data-view-router.js - About 3 hrs to fix

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

          export function findColorValues({ mainSegment, segmentName, parallels, lang }) {
            let WordList = [];
            let colourValues = [];
            let position = 0;
            let Words = mainSegment;
          Severity: Minor
          Found in src/views/textview/textViewUtils.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 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 render has 87 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

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

                Function styles has 81 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  static get styles() {
                    return [
                      css`
                        :host {
                          position: relative;
                Severity: Major
                Found in src/views/data/data-view-header.js - About 3 hrs to fix

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

                  import { css, customElement, html, LitElement, property } from 'lit-element';
                  
                  import '@vaadin/vaadin-combo-box/theme/material/vaadin-combo-box';
                  import '@vaadin/vaadin-select/theme/material/vaadin-select';
                  
                  
                  Severity: Minor
                  Found in src/views/data/data-view-header-fields.js - About 3 hrs to fix

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

                      render() {
                        //prettier-ignore
                        return html`
                          <div class="selection-box">
                            <bn-card>
                    Severity: Major
                    Found in src/views/visual/visual-view-header.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 render has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        render() {
                          if (this.fetchLoading) {
                            return html`
                              <bn-loading-spinner></bn-loading-spinner>
                            `;
                      Severity: Major
                      Found in src/views/graphview/graph-view.js - About 3 hrs to fix

                        Function collectionMenu has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          collectionMenu() {
                            if (!this.navigationMenuData) {
                              return;
                            }
                            let collectionMenuData = html``;
                        Severity: Major
                        Found in src/views/menus/navigation-menu.js - About 2 hrs to fix

                          File formatted-segment.js has 287 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          import { customElement, html, LitElement, property, css } from 'lit-element';
                          
                          import { getDisplayName } from '../../api/actions';
                          import { getLanguageFromFilename } from './views-common';
                          import { segmentArrayToString } from './preprocessing';
                          Severity: Minor
                          Found in src/views/utility/formatted-segment.js - About 2 hrs to fix

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

                            import { customElement, html, css, LitElement, property } from 'lit-element';
                            
                            import 'multiselect-combo-box/theme/material/multiselect-combo-box';
                            
                            import '../utility/LoadingSpinner';
                            Severity: Minor
                            Found in src/views/data/data-view-filters-container.js - About 2 hrs to fix

                              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

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

                                import { customElement, html, LitElement } from 'lit-element';
                                
                                import styles from './../static-view.styles';
                                
                                @customElement('news-view')
                                Severity: Minor
                                Found in src/views/static/news/news-view.js - About 2 hrs to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language