BuddhaNexus/buddhanexus-frontend

View on GitHub

Showing 280 of 280 total issues

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

  render() {
    if (this.fetchLoading || !this.displayName) {
      // prettier-ignore
      return html`<span class="formatted-segment" title="${this.filename}">${this.filename}:${this.number}</span>`
    }
Severity: Minor
Found in src/views/utility/formatted-segment.js - About 1 hr to fix

    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

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

          while (i >= orig_i && tokens[i] != null) {
            t = tokens[i--];
            if (t == '+' || t == '^') continue;
            if (consonant(t) == null) break;
            out.unshift(t);
        Severity: Major
        Found in src/views/utility/tibetan-transliteration.js and 1 other location - About 1 hr to fix
        src/views/utility/tibetan-transliteration.js on lines 912..917

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

        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

              return html`
                <text-view-search
                  .lang="${this.lang}"
                  .fileName="${this.fileName}"
                  .searchString="${this.searchString}"
        Severity: Major
        Found in src/views/textview/text-view-router.js and 1 other location - About 1 hr to fix
        src/views/visual/visual-view-header.js on lines 169..199

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

        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

          while (tokens[i] != null) {
            t = tokens[i++];
            if (t == '+' || t == '^') continue;
            if (consonant(t) == null) break;
            out.push(t);
        Severity: Major
        Found in src/views/utility/tibetan-transliteration.js and 1 other location - About 1 hr to fix
        src/views/utility/tibetan-transliteration.js on lines 928..933

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

        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

                          ? html`
                              <multiselect-combo-box
                                Label="Hit Collections"
                                id="target-visual-view-dropdown"
                                item-label-path="collectionname"
        Severity: Major
        Found in src/views/visual/visual-view-header.js and 1 other location - About 1 hr to fix
        src/views/textview/text-view-router.js on lines 51..60

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

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

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

                          } else if (this.selectedView === DATA_VIEW_MODES.GRAPH) {
                            return html`
                              <graph-view
                                .fileName="${this.fileName}"
                                .targetCollection="${this.targetCollection}"
                      Severity: Major
                      Found in src/views/data/data-view-router.js and 1 other location - About 1 hr to fix
                      src/views/data/data-view-router.js on lines 98..128

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

                      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

                          } else if (this.selectedView === DATA_VIEW_MODES.MULTILING) {
                            return html`
                              <table-view-multiling
                                .fileName="${this.fileName}"
                                .score="${this.score}"
                      Severity: Major
                      Found in src/views/data/data-view-router.js and 1 other location - About 1 hr to fix
                      src/views/data/data-view-router.js on lines 74..128

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

                      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 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
                        Severity
                        Category
                        Status
                        Source
                        Language