BuddhaNexus/buddhanexus-frontend

View on GitHub

Showing 280 of 280 total issues

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

  static get styles() {
    return [
      css`
        .card {
          padding: 12px 24px 24px 24px;
Severity: Minor
Found in src/views/components/card.js - About 1 hr to fix

    Identical blocks of code found in 3 locations. Consider refactoring.
    Open

          if (propName === 'fileName' && !this.fetchLoading) {
            if (this.folio) {
              this.folio = '';
            }
            this.resetView();
    Severity: Major
    Found in src/views/tableview/table-view-multiling.js and 2 other locations - About 1 hr to fix
    src/views/numbersview/numbers-view.js on lines 52..58
    src/views/tableview/table-view.js on lines 62..68

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

    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

    Identical blocks of code found in 3 locations. Consider refactoring.
    Open

          if (propName === 'fileName' && !this.fetchLoading) {
            if (this.folio) {
              this.folio = '';
            }
            this.resetView();
    Severity: Major
    Found in src/views/numbersview/numbers-view.js and 2 other locations - About 1 hr to fix
    src/views/tableview/table-view-multiling.js on lines 72..78
    src/views/tableview/table-view.js on lines 62..68

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

    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

    Identical blocks of code found in 3 locations. Consider refactoring.
    Open

          if (propName === 'fileName' && !this.fetchLoading) {
            if (this.folio) {
              this.folio = '';
            }
            this.resetView();
    Severity: Major
    Found in src/views/tableview/table-view.js and 2 other locations - About 1 hr to fix
    src/views/numbersview/numbers-view.js on lines 52..58
    src/views/tableview/table-view-multiling.js on lines 72..78

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

    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 render has 37 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: Minor
    Found in src/views/static/publications/publications-view.js - About 1 hr to fix

      Function updated has 37 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        updated(_changedProperties) {
          this.scrollRightText();
          _changedProperties.forEach((oldValue, propName) => {
            if (['rightFileName'].includes(propName)) {
              this.parallels = {};
      Severity: Minor
      Found in src/views/textview/text-view-right.js - About 1 hr to fix

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

          render() {
            return html`
              <text-view-header
                .fileName="${this.fileName}"
                .lang="${this.lang}"
        Severity: Minor
        Found in src/views/textview/text-view.js - About 1 hr to fix

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

          function setLogoVisibility(isVisible) {
            const logo = getMainLayout().querySelector('.logo-buddhanexus');
            if (!isVisible) {
              logo.setAttribute('style', 'visibility: hidden');
            } else {
          Severity: Major
          Found in src/views/utility/utils.js and 1 other location - About 1 hr to fix
          src/views/utility/utils.js on lines 64..71

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

          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

          function setFooterVisibility(isVisible) {
            const footer = getMainLayout().querySelector('footer');
            if (!isVisible) {
              footer.setAttribute('style', 'display: none');
            } else {
          Severity: Major
          Found in src/views/utility/utils.js and 1 other location - About 1 hr to fix
          src/views/utility/utils.js on lines 55..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 64.

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

              render() {
                if (this.fetchLoading) {
                  return html`
                    <bn-loading-spinner></bn-loading-spinner>
                  `;
            Severity: Minor
            Found in src/views/textview/text-view-search.js - About 1 hr to fix

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

              export const minimumLengthText = language => {
                let minLength;
                let languageFull;
                let charOrSyl;
                switch (language) {
              Severity: Minor
              Found in src/views/data/data-view-subheader.js - About 1 hr to fix

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

                  render() {
                    return html`
                      <vaadin-radio-group
                        label="Choose view:"
                        class="visibility-filters"
                Severity: Minor
                Found in src/views/data/data-view-view-selector.js - About 1 hr to fix

                  Function getLinkForSegmentNumbers has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    getLinkForSegmentNumbers(language, segmentnr) {
                      // prettier-ignore
                      const dhpVerses = [1,21,33,44,60,76,90,100,116,129,146,157,167,179,197,
                                          209,221,235,256,273,290,306,320,334,360,383,424]
                      let linkText = '';
                  Severity: Minor
                  Found in src/views/utility/formatted-segment.js - About 1 hr to fix

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

                      static get styles() {
                        return [
                          css`
                            .side-sheet {
                              display: flex;
                    Severity: Minor
                    Found in src/views/components/side-sheet.js - About 1 hr to fix

                      Function addSegmentObservers has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        async addSegmentObservers() {
                          if (!this.shadowRoot.querySelector('.right-segment')) {
                            return;
                          }
                      
                      
                      Severity: Minor
                      Found in src/views/textview/text-view-right.js - About 1 hr to fix

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

                          render() {
                            //prettier-ignore
                            return html`
                              <div class="table-container">
                                <table-view-table-header
                        Severity: Minor
                        Found in src/views/tableview/table-view-table.js - About 1 hr to fix

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

                                  if (
                                    parallels[i].root_offset_beg > this.data.position &&
                                    parallels[i].root_segnr[0] === this.data.activeSegment
                                  ) {
                                    positionFlag = 0;
                          Severity: Major
                          Found in src/views/textview/text-view-middle.js and 1 other location - About 1 hr to fix
                          src/views/textview/text-view-middle.js on lines 143..148

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

                          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 (
                                    parallels[i].root_offset_beg <= this.data.position &&
                                    parallels[i].root_segnr[0] === this.data.activeSegment
                                  ) {
                                    positionFlag = 1;
                          Severity: Major
                          Found in src/views/textview/text-view-middle.js and 1 other location - About 1 hr to fix
                          src/views/textview/text-view-middle.js on lines 155..160

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

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

                          export default function TextViewInfoModalContent(language) {
                            return html`
                              <div>
                                <p>
                                  The color coding of the syllables in the Inquiry Text indicates how many
                          Severity: Minor
                          Found in src/views/textview/text-view-modal-content.js - About 1 hr to fix
                            Severity
                            Category
                            Status
                            Source
                            Language