BuddhaNexus/buddhanexus-frontend

View on GitHub

Showing 280 of 280 total issues

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

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

              renderSanskrit() {
                if (this.mainLang == LANGUAGE_CODES.SANSKRIT) {
                  return html`
                    <vaadin-checkbox
                      value="skt"
            Severity: Major
            Found in src/views/data/data-view-filters-multilingual.js and 3 other locations - About 2 hrs to fix
            src/views/data/data-view-filters-multilingual.js on lines 91..111
            src/views/data/data-view-filters-multilingual.js on lines 135..155
            src/views/data/data-view-filters-multilingual.js on lines 157..177

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

            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

              renderPali() {
                if (this.mainLang == LANGUAGE_CODES.PALI) {
                  return html`
                    <vaadin-checkbox
                      value="pli"
            Severity: Major
            Found in src/views/data/data-view-filters-multilingual.js and 3 other locations - About 2 hrs to fix
            src/views/data/data-view-filters-multilingual.js on lines 113..133
            src/views/data/data-view-filters-multilingual.js on lines 135..155
            src/views/data/data-view-filters-multilingual.js on lines 157..177

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

            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

              renderChinese() {
                if (this.mainLang == LANGUAGE_CODES.CHINESE) {
                  return html`
                    <vaadin-checkbox
                      value="chn"
            Severity: Major
            Found in src/views/data/data-view-filters-multilingual.js and 3 other locations - About 2 hrs to fix
            src/views/data/data-view-filters-multilingual.js on lines 91..111
            src/views/data/data-view-filters-multilingual.js on lines 113..133
            src/views/data/data-view-filters-multilingual.js on lines 135..155

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

            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

              renderTibetan() {
                if (this.mainLang == LANGUAGE_CODES.TIBETAN) {
                  return html`
                    <vaadin-checkbox
                      value="tib"
            Severity: Major
            Found in src/views/data/data-view-filters-multilingual.js and 3 other locations - About 2 hrs to fix
            src/views/data/data-view-filters-multilingual.js on lines 91..111
            src/views/data/data-view-filters-multilingual.js on lines 113..133
            src/views/data/data-view-filters-multilingual.js on lines 157..177

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

            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

                switch (par_lang) {
                  case LANGUAGE_CODES.TIBETAN:
                    title = LANGUAGE_NAMES.TIBETAN;
                    break;
                  case LANGUAGE_CODES.SANSKRIT:
            Severity: Major
            Found in src/views/utility/formatted-segment.js and 1 other location - About 2 hrs to fix
            src/views/menus/navigation-menu.js on lines 147..162

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

            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

                      switch (file.filelanguage) {
                        case LANGUAGE_CODES.TIBETAN:
                          collectionName = LANGUAGE_NAMES.TIBETAN;
                          break;
                        case LANGUAGE_CODES.PALI:
            Severity: Major
            Found in src/views/menus/navigation-menu.js and 1 other location - About 2 hrs to fix
            src/views/utility/formatted-segment.js on lines 47..62

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

            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

            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

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

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

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

                import { customElement, html, LitElement, property } from 'lit-element';
                import { removeDuplicates } from '../utility/views-common';
                import { getFileTextAndParallels } from '../../api/actions';
                
                import sharedDataViewStyles from '../data/data-view-shared.styles';
                Severity: Minor
                Found in src/views/textview/text-view-left.js - About 2 hrs to fix

                  Function render has 65 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/presentations/presentations-view.js - About 2 hrs to fix

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

                      render() {
                        const shouldShowTransliterationSlider =
                          ((this.language === 'tib' || this.language === 'multi') &&
                            this.viewMode != 'graph') ||
                          this.viewMode === 'english';
                    Severity: Major
                    Found in src/views/data/data-view-header.js - About 2 hrs to fix

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

                            ${shouldShowMultiLingSearchBox
                              ? html`
                                  <paper-input
                                    placeholder="Search"
                                    class="search-box"
                      Severity: Major
                      Found in src/views/data/data-view-header-fields.js and 1 other location - About 2 hrs to fix
                      src/views/data/data-view-header-fields.js on lines 277..294

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

                      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

                            ${shouldShowTextSearchBox
                              ? html`
                                  <paper-input
                                    placeholder="Search in Inquiry Text"
                                    class="search-box"
                      Severity: Major
                      Found in src/views/data/data-view-header-fields.js and 1 other location - About 2 hrs to fix
                      src/views/data/data-view-header-fields.js on lines 295..312

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

                      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

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

                        static get styles() {
                          return [
                            sharedDataViewStyles,
                            css`
                              #text-view-header {
                      Severity: Major
                      Found in src/views/textview/text-view-header.js - About 2 hrs to fix
                        Severity
                        Category
                        Status
                        Source
                        Language