BuddhaNexus/buddhanexus-frontend

View on GitHub

Showing 155 of 280 total issues

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

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

    Function addCatagoryFiles has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      addCatagoryFiles(files) {
        let pictureFiles = preprocessMenuData(files);
        let totalFilesList = [];
        if (pictureFiles.length !== 0) {
          totalFilesList = pictureFiles.map(
    Severity: Minor
    Found in src/views/menus/navigation-menu.js - About 1 hr to fix

      Function render has 28 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/people/people-view.js - About 1 hr to fix

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

          updated(_changedProperties) {
            super.updated(_changedProperties);
            this.lang = getLanguageFromFilename(this.fileName);
            _changedProperties.forEach(async (oldValue, propName) => {
              if (propName === 'fileName' && !this.fetchLoading) {
        Severity: Minor
        Found in src/views/tableview/table-view.js - About 1 hr to fix

          Function fetchData has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            async fetchData() {
              if (!this.fileName) {
                this.fetchLoading = false;
                return;
              }
          Severity: Minor
          Found in src/views/numbersview/numbers-view.js - About 1 hr to fix

            Function TextViewLayoutRight has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const TextViewLayoutRight = (
              textRight,
              parallels,
              clickFunction,
              rightTextData,
            Severity: Minor
            Found in src/views/textview/text-view-right.js - About 1 hr to fix

              Function parseDisplayData has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                parseDisplayData(displayData, segmentnrString) {
                  this.displayName = displayData ? displayData[0] : '';
                  if (!this.shouldNotShowExtLink) {
                    if (
                      this.lang === LANGUAGE_CODES.SANSKRIT ||
              Severity: Minor
              Found in src/views/utility/formatted-segment.js - About 1 hr 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 TextSegment has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

              export function TextSegment({
                inputData,
                lang,
                colorValues,
                onClick = 0,
              Severity: Minor
              Found in src/views/textview/TextSegment.js - About 1 hr 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 fetchNewText has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                async fetchNewText() {
                  this.fetchLoading = true;
                  const { textleft, parallels, error } = await getFileTextAndParallels({
                    fileName: this.fileName,
                    limit_collection: this.limitCollection,
              Severity: Minor
              Found in src/views/textview/text-view-left.js - About 1 hr 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 preprocessMenuData has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export function preprocessMenuData(menuData) {
                // this function has a bit of spaghetti-style; maybe we can refactor it at some point.
                return menuData.map(menuEntry => {
                  menuEntry.imgStringPLI = '';
                  menuEntry.imgStringSKT = '';
              Severity: Minor
              Found in src/views/utility/utils.js - About 1 hr to fix

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

                  render() {
                    if (!this.fileName) {
                      //prettier-ignore
                      return html`
                        <div class="data-view-subheader">
                Severity: Minor
                Found in src/views/data/data-view-subheader.js - About 1 hr to fix

                  Function getIcon has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    getIcon(par_lang) {
                      if (!this.logo) {
                        return;
                      }
                      let title;
                  Severity: Minor
                  Found in src/views/utility/formatted-segment.js - About 1 hr to fix

                    Function firstUpdated has 26 lines of code (exceeds 25 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 1 hr to fix

                      Consider simplifying this complex logical expression.
                      Open

                          if (
                            (this.viewMode === DATA_VIEW_MODES.TEXT ||
                              this.viewMode === DATA_VIEW_MODES.TEXT_SEARCH ||
                              this.viewMode === DATA_VIEW_MODES.TABLE ||
                              this.viewMode === DATA_VIEW_MODES.NUMBERS ||
                      Severity: Major
                      Found in src/views/data/data-view-header-fields.js - About 1 hr to fix

                        Function addSegmentObservers has a Cognitive Complexity of 9 (exceeds 5 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 55 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 exportJsEWTS has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function exportJsEWTS(global) {
                          const jsEWTS = {
                            fromWylie: fromWylie,
                            toWylie: toWylie,
                          };
                        Severity: Minor
                        Found in src/views/utility/tibetan-transliteration.js - About 55 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 getExternalLinkName has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                          getExternalLinkName(language, externalLink) {
                            if (!externalLink) {
                              return;
                            }
                            let linkName = '';
                        Severity: Minor
                        Found in src/views/utility/formatted-segment.js - About 55 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 render has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                          render() {
                            if (
                              this.selectedView === DATA_VIEW_MODES.TEXT ||
                              this.selectedView === DATA_VIEW_MODES.TEXT_SEARCH
                            ) {
                        Severity: Minor
                        Found in src/views/data/data-view-router.js - About 55 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 TextSegmentWords has 7 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                          inputData,
                          lang,
                          colorValues,
                          highlightMode,
                          onClick,
                        Severity: Major
                        Found in src/views/textview/TextSegment.js - About 50 mins to fix

                          Function getLeftSegmentColors has 6 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                            current_parallels,
                            segText,
                            segmentNr,
                            lang,
                            leftSideSelected,
                          Severity: Minor
                          Found in src/views/textview/LeftSegment.js - About 45 mins to fix
                            Severity
                            Category
                            Status
                            Source
                            Language