BuddhaNexus/buddhanexus-frontend

View on GitHub

Showing 280 of 280 total issues

File tibetan-transliteration.js has 1789 lines of code (exceeds 250 allowed). Consider refactoring.
Open

function newHashSet() {
  var x = [];
  x.add = function(K) {
    if (this.indexOf(K) < 0) this.push(K);
  };
Severity: Major
Found in src/views/utility/tibetan-transliteration.js - About 4 days to fix

    Function fromWylieOneStack has a Cognitive Complexity of 121 (exceeds 5 allowed). Consider refactoring.
    Open

    function fromWylieOneStack(tokens, i, opts) {
      var orig_i = i;
      var t = '',
        t2 = ''; //, o = ''
      var out = '';
    Severity: Minor
    Found in src/views/utility/tibetan-transliteration.js - About 2 days 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 fromWylie has a Cognitive Complexity of 92 (exceeds 5 allowed). Consider refactoring.
    Open

    export function fromWylie(str, opts, warns) {
      if (!warns) {
        warns = [];
      }
      if (!opts) {
    Severity: Minor
    Found in src/views/utility/tibetan-transliteration.js - About 1 day 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 271 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/news/news-view.js - About 1 day to fix

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

        render() {
          let newActiveSegment = this.activeSegment;
          if (this.activeSegment && this.activeSegment !== 'none') {
            if (this.activeSegment.startsWith('en-')) {
              newActiveSegment = 'ai-' + this.activeSegment.substr(3).split('_')[0];
      Severity: Major
      Found in src/views/englishview/english-view-middle.js and 1 other location - About 1 day to fix
      src/views/englishview/english-view-right.js on lines 45..66

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

      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

        render() {
          let newActiveSegment = this.activeSegment;
          if (this.activeSegment && this.activeSegment !== 'none') {
            if (this.activeSegment.startsWith('ai-')) {
              newActiveSegment = 'en-' + this.activeSegment.substr(3).split('_')[0];
      Severity: Major
      Found in src/views/englishview/english-view-right.js and 1 other location - About 1 day to fix
      src/views/englishview/english-view-middle.js on lines 42..63

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

      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 toWylie has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring.
      Open

      export function toWylie(str, escape, warns) {
        if (!warns) {
          warns = [];
        }
        if (escape === undefined) escape = true;
      Severity: Minor
      Found in src/views/utility/tibetan-transliteration.js - About 1 day 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 fromWylieOneTsekbar has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
      Open

      function fromWylieOneTsekbar(tokens, i, opts) {
        // (str, int)
        var orig_i = i;
        var t = tokens[i];
        // variables for tracking the state within the syllable as we parse it
      Severity: Minor
      Found in src/views/utility/tibetan-transliteration.js - About 1 day 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 fromWylieOneStack has 190 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function fromWylieOneStack(tokens, i, opts) {
        var orig_i = i;
        var t = '',
          t2 = ''; //, o = ''
        var out = '';
      Severity: Major
      Found in src/views/utility/tibetan-transliteration.js - About 7 hrs to fix

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

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

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

            addInfiniteScrollListener = async () => {
              await this.updateComplete;
              const tableRows = this.shadowRoot
                .querySelector('table-view-table')
                .shadowRoot.querySelectorAll('.table-view-table__row');
          Severity: Major
          Found in src/views/tableview/table-view-multiling.js and 1 other location - About 5 hrs to fix
          src/views/tableview/table-view.js on lines 126..141

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

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

            addInfiniteScrollListener = async () => {
              await this.updateComplete;
              const tableRows = this.shadowRoot
                .querySelector('table-view-table')
                .shadowRoot.querySelectorAll('.table-view-table__row');
          Severity: Major
          Found in src/views/tableview/table-view.js and 1 other location - About 5 hrs to fix
          src/views/tableview/table-view-multiling.js on lines 127..142

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

          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 a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
          Open

            render() {
              if (!this.data) {
                //prettier-ignore
                return html`<span lang="en">Click on a syllable in the Inquiry Text to display the approximate
                    matches. Only colored syllables have parallels. Black text has no
          Severity: Minor
          Found in src/views/textview/text-view-middle.js - About 5 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 toWylieOneStack has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
          Open

          function toWylieOneStack(str, len, i) {
            var orig_i = i;
            var ffinal = null,
              vowel = null,
              klass = null;
          Severity: Minor
          Found in src/views/utility/tibetan-transliteration.js - About 5 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

          File data-view.js has 385 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /**
           * @file data-view is the container component of table-view, numbers-view, table-view and graph-view.
           *
           * @todo:
           * - pass filter values inside an object instead of separately in order to simplify code.
          Severity: Minor
          Found in src/views/data/data-view.js - About 5 hrs to fix

            Function render has 130 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/guidelines/guidelines-view.js - About 5 hrs to fix

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

              export const getParallelCount = async ({
                fileName,
                limit_collection,
                ...queryParams
              }) => {
              Severity: Major
              Found in src/api/actions.js and 5 other locations - About 5 hrs to fix
              src/api/actions.js on lines 13..32
              src/api/actions.js on lines 34..53
              src/api/actions.js on lines 55..74
              src/api/actions.js on lines 76..95
              src/api/actions.js on lines 97..116

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

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

              export const getSegmentsForFile = async ({
                fileName,
                limit_collection,
                ...queryParams
              }) => {
              Severity: Major
              Found in src/api/actions.js and 5 other locations - About 5 hrs to fix
              src/api/actions.js on lines 34..53
              src/api/actions.js on lines 55..74
              src/api/actions.js on lines 76..95
              src/api/actions.js on lines 97..116
              src/api/actions.js on lines 231..250

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

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

              export const getDataForGraph = async ({
                fileName,
                target_collection,
                ...queryParams
              }) => {
              Severity: Major
              Found in src/api/actions.js and 5 other locations - About 5 hrs to fix
              src/api/actions.js on lines 13..32
              src/api/actions.js on lines 34..53
              src/api/actions.js on lines 55..74
              src/api/actions.js on lines 97..116
              src/api/actions.js on lines 231..250

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

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

              export const getDataForVisual = async ({
                searchTerm,
                selected,
                ...queryParams
              }) => {
              Severity: Major
              Found in src/api/actions.js and 5 other locations - About 5 hrs to fix
              src/api/actions.js on lines 13..32
              src/api/actions.js on lines 34..53
              src/api/actions.js on lines 55..74
              src/api/actions.js on lines 76..95
              src/api/actions.js on lines 231..250

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

              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

              Severity
              Category
              Status
              Source
              Language