BuddhaNexus/buddhanexus-frontend

View on GitHub

Showing 280 of 280 total issues

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

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

      render() {
        const renderSwitchButton =
          this.renderSwitchButton && this.rightFileName !== '';
    
        //prettier-ignore
    Severity: Minor
    Found in src/views/textview/text-view-header.js - About 1 hr to fix

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

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

        Function fetchNewText has 33 lines of code (exceeds 25 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

          Function fetchDataText has 32 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            async fetchDataText() {
              if (!this.rightFileName) {
                this.fetchLoading = false;
                return;
              }
          Severity: Minor
          Found in src/views/textview/text-view-right.js - About 1 hr to fix

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

              static get styles() {
                return [
                  css`
                    .bn-loading-spinner {
                      width: 48px;
            Severity: Minor
            Found in src/views/utility/LoadingSpinner.js - About 1 hr to fix

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

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

                  displayParallels(element) {
                    if (!element) {
                      return;
                    }
                
                
                Severity: Minor
                Found in src/views/textview/text-view-left.js - About 1 hr to fix

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

                    render() {
                      const showMiddleData = !isObjectEmpty(this.middleData);
                  
                      if (!this.fileName) {
                        return null;
                  Severity: Minor
                  Found in src/views/textview/text-view-table.js - About 1 hr to fix

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

                    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 11 (exceeds 5 allowed). Consider refactoring.
                    Open

                      render() {
                        const shouldShowTransliterationSlider =
                          ((this.language === 'tib' || this.language === 'multi') &&
                            this.viewMode != 'graph') ||
                          this.viewMode === 'english';
                    Severity: Minor
                    Found in src/views/data/data-view-header.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 TextSegmentWords has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function TextSegmentWords(
                      inputData,
                      lang,
                      colorValues,
                      highlightMode,
                    Severity: Minor
                    Found in src/views/textview/TextSegment.js - About 1 hr to fix

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

                        render() {
                          if (this.selectedView === DATA_VIEW_MODES.TEXT_SEARCH) {
                            return html`
                              <text-view-search
                                .lang="${this.lang}"
                      Severity: Minor
                      Found in src/views/textview/text-view-router.js - About 1 hr to fix

                        Function updated has 31 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 === 'pageNumber' && !this.fetchLoading) {
                        Severity: Minor
                        Found in src/views/numbersview/numbers-view.js - About 1 hr to fix

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

                            getExternalLinkName(language, externalLink) {
                              if (!externalLink) {
                                return;
                              }
                              let linkName = '';
                          Severity: Minor
                          Found in src/views/utility/formatted-segment.js - About 1 hr to fix

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

                              static get styles() {
                                return [
                                  css`
                                    :host {
                                      display: inline-flex;
                            Severity: Minor
                            Found in src/views/utility/source-link.js - About 1 hr to fix

                              Function render has 30 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/tools/sanskrit-tools.js - About 1 hr to fix

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

                                  async fetchData() {
                                    this.fetchLoading = true;
                                    const { link, error } = await getExternalLink({
                                      fileName: this.filename,
                                    });
                                Severity: Minor
                                Found in src/views/utility/source-link.js - About 1 hr to fix

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

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

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

                                      initializeFilterValues(lang) {
                                        switch (lang) {
                                          case LANGUAGE_CODES.TIBETAN:
                                            this.minLength = MIN_LENGTHS.TIBETAN;
                                            this.quoteLength = DEFAULT_LENGTHS.TIBETAN;
                                    Severity: Minor
                                    Found in src/views/data/data-view.js - About 1 hr to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language