BuddhaNexus/buddhanexus-frontend

View on GitHub

Showing 155 of 280 total issues

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

    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

          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

            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

                  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

                                  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

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

                                      updated(_changedProperties) {
                                        _changedProperties.forEach(async (oldValue, propName) => {
                                          if (propName === 'fileName' && !this.fetchLoading) {
                                            if (!('leftTextData' in _changedProperties)) {
                                              this.handleFilenameChanged();
                                    Severity: Minor
                                    Found in src/views/textview/text-view-left.js - About 1 hr to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language