BuddhaNexus/buddhanexus-frontend

View on GitHub

Showing 280 of 280 total issues

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

  static get styles() {
    return [
      css`
        :host {
          width: 100%;
Severity: Minor
Found in src/views/data/data-view-filter-sliders.js - About 1 hr to fix

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

            if (
              parallels[i].root_offset_end < this.data.position &&
              parallels[i].root_segnr.slice(-1)[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 149..154

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

    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.NUMBERS) {
          return html`
            <numbers-view
              .fileName="${this.fileName}"
              .folio="${this.folio}"
    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 108..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 72.

    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.ENGLISH) {
          return html`
            <english-view-router
              .fileName="${this.fileName}"
              .folio="${this.folio}"
    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 62..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 72.

    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_end >= this.data.position &&
              parallels[i].root_segnr.slice(-1)[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 161..166

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

    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 46 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/home/home-view.js - About 1 hr to fix

      Function displayParallels has 46 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        displayParallels(e) {
          if (!e || !e.target) {
            return;
          }
          let allSegments = this.shadowRoot.querySelectorAll(
      Severity: Minor
      Found in src/views/textview/text-view-right.js - About 1 hr to fix

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

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

          Function highlightParallel has 45 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            highlightParallel({
              rootSegments,
              rootOffsetBegin,
              rootOffsetEnd,
              rightMode,
          Severity: Minor
          Found in src/views/textview/text-view.js - About 1 hr to fix

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

                  case LANGUAGE_CODES.TIBETAN:
                    this.minLength = MIN_LENGTHS.TIBETAN;
                    this.quoteLength = DEFAULT_LENGTHS.TIBETAN;
                    this.score = DEFAULT_SCORES.TIBETAN;
                    this.multiLingualMode = [LANGUAGE_CODES.TIBETAN];
            Severity: Major
            Found in src/views/data/data-view.js and 2 other locations - About 1 hr to fix
            src/views/data/data-view.js on lines 88..93
            src/views/data/data-view.js on lines 100..105

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

            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 3 locations. Consider refactoring.
            Open

                  case LANGUAGE_CODES.PALI:
                    this.minLength = MIN_LENGTHS.PALI;
                    this.quoteLength = DEFAULT_LENGTHS.PALI;
                    this.score = DEFAULT_SCORES.PALI;
                    this.multiLingualMode = [LANGUAGE_CODES.PALI];
            Severity: Major
            Found in src/views/data/data-view.js and 2 other locations - About 1 hr to fix
            src/views/data/data-view.js on lines 82..87
            src/views/data/data-view.js on lines 100..105

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

            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 3 locations. Consider refactoring.
            Open

                  case LANGUAGE_CODES.CHINESE:
                    this.minLength = MIN_LENGTHS.CHINESE;
                    this.quoteLength = DEFAULT_LENGTHS.CHINESE;
                    this.score = DEFAULT_SCORES.CHINESE;
                    this.multiLingualMode = [LANGUAGE_CODES.CHINESE];
            Severity: Major
            Found in src/views/data/data-view.js and 2 other locations - About 1 hr to fix
            src/views/data/data-view.js on lines 82..87
            src/views/data/data-view.js on lines 88..93

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

            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 44 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/introduction/introduction-view.js - About 1 hr to fix

              Function getLinkForSegmentNumbers has a Cognitive Complexity of 14 (exceeds 5 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

              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

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

                return html`<span 
                              class="right-segment"
                              id=${segmentNr}
                              title=${displayNumber}
                              number="${number}">
              Severity: Major
              Found in src/views/textview/text-view-right.js and 1 other location - About 1 hr to fix
              src/views/textview/LeftSegment.js on lines 102..114

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

              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`<span class="left-segment"
                              title=${displayNumber}
                              id=${segmentNr}
                              number="${number}">
                              ${firstDisplayNumber
              Severity: Major
              Found in src/views/textview/LeftSegment.js and 1 other location - About 1 hr to fix
              src/views/textview/text-view-right.js on lines 381..394

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

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

                static get styles() {
                  return [
                    css`
                      :host {
                        display: flex;
              Severity: Minor
              Found in src/views/data/data-view-header-fields.js - About 1 hr to fix

                Function rightSegmentContainer has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                const rightSegmentContainer = (
                  segmentNr,
                  segText,
                  current_parallels,
                  number,
                Severity: Minor
                Found in src/views/textview/text-view-right.js - About 1 hr to fix

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

                    async addSegmentObservers() {
                      if (this.addedSegmentObservers) {
                        return;
                      }
                      const targets = this.shadowRoot.querySelectorAll('.left-segment');
                  Severity: Minor
                  Found in src/views/textview/text-view-left.js - About 1 hr to fix

                    Function getCleanedWord has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function getCleanedWord(lang, splitWords, i, transMethod) {
                      let cleanedWord = '';
                      if (lang === LANGUAGE_CODES.TIBETAN) {
                        if (transMethod == 'uni') {
                          let word = splitWords[i];
                    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

                    Severity
                    Category
                    Status
                    Source
                    Language