demo/src/scripts/ui/Menu.js

Summary

Maintainability
F
1 mo
Test Coverage

File Menu.js has 2631 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import $ from 'jquery'
import _ from 'lodash'
import { Miew } from 'miew'
import menuHtml from '../../menu.html'
import 'bootstrap'
Severity: Major
Found in demo/src/scripts/ui/Menu.js - About 1 wk to fix

    Function _addReprListItem has 371 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    Menu.prototype._addReprListItem = function (panel, index, repr) {
      const self = this
      const reprList = $(
        `${self._menuId} [data-panel-type=miew-menu-panel-representation] .miew-repr-list`
      )
    Severity: Major
    Found in demo/src/scripts/ui/Menu.js - About 1 day to fix

      Function _init has 207 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      Menu.prototype._init = function () {
        const self = this
        let selectorHide = null
        let selectorShow = null
        let newPanelId = null
      Severity: Major
      Found in demo/src/scripts/ui/Menu.js - About 1 day to fix

        Function _initSelectionPanel has 187 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        Menu.prototype._initSelectionPanel = function () {
          const self = this
          const selectionPanel = $(
            `${self._menuId} [data-panel-type=miew-menu-panel-selection]`
          )
        Severity: Major
        Found in demo/src/scripts/ui/Menu.js - About 7 hrs to fix

          Function _initReprListItemListeners has 148 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          Menu.prototype._initReprListItemListeners = function (index) {
            const self = this
            const reprList = $(
              `${self._menuId} [data-panel-type=miew-menu-panel-representation] .miew-repr-list`
            )
          Severity: Major
          Found in demo/src/scripts/ui/Menu.js - About 5 hrs to fix

            Function _updateReprList has 140 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            Menu.prototype._updateReprList = function () {
              const self = this
            
              function _createOptionsFromMVData(index, property, element, itemId) {
                const curRep = self._viewer.repGet(index)
            Severity: Major
            Found in demo/src/scripts/ui/Menu.js - About 5 hrs to fix

              Function _fillReprList has 128 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              Menu.prototype._fillReprList = function () {
                const self = this
                const reprList = $(
                  `${self._menuId} .panel-menu[data-panel-type=miew-menu-panel-representation] .miew-repr-list`
                )
              Severity: Major
              Found in demo/src/scripts/ui/Menu.js - About 5 hrs to fix

                Function _initializeTerminal has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
                Open

                Menu.prototype._initializeTerminal = function () {
                  const self = this
                  let res = null
                  let urlSubString = ''
                  const element = $(
                Severity: Minor
                Found in demo/src/scripts/ui/Menu.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 _presetsPanelActionsPdbInputsRefresh has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                Open

                Menu.prototype._presetsPanelActionsPdbInputsRefresh = function (self) {
                  const loadPdbButton = $(
                    `${self._menuId} .presets-panel-action[data-presets-panel-action=pdb-load]`
                  )
                  const clearInputsButton = $(
                Severity: Minor
                Found in demo/src/scripts/ui/Menu.js - About 4 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 _presetsPanelActionsPdbInputsRefresh has 100 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                Menu.prototype._presetsPanelActionsPdbInputsRefresh = function (self) {
                  const loadPdbButton = $(
                    `${self._menuId} .presets-panel-action[data-presets-panel-action=pdb-load]`
                  )
                  const clearInputsButton = $(
                Severity: Major
                Found in demo/src/scripts/ui/Menu.js - About 4 hrs to fix

                  Function _initToolbar has 99 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  Menu.prototype._initToolbar = function () {
                    const self = this
                  
                    const frag = document.createDocumentFragment()
                    let newItem
                  Severity: Major
                  Found in demo/src/scripts/ui/Menu.js - About 3 hrs to fix

                    Function _init has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
                    Open

                    Menu.prototype._init = function () {
                      const self = this
                      let selectorHide = null
                      let selectorShow = null
                      let newPanelId = null
                    Severity: Minor
                    Found in demo/src/scripts/ui/Menu.js - About 3 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 _initToolsPanel has 92 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    Menu.prototype._initToolsPanel = function () {
                      const self = this
                      $(
                        `${self._menuId} .miew-menu-modals [data-modal-type=miew-menu-modal-url]`
                      ).on('shown.bs.modal', () => {
                    Severity: Major
                    Found in demo/src/scripts/ui/Menu.js - About 3 hrs to fix

                      Function _initializeTerminal has 92 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      Menu.prototype._initializeTerminal = function () {
                        const self = this
                        let res = null
                        let urlSubString = ''
                        const element = $(
                      Severity: Major
                      Found in demo/src/scripts/ui/Menu.js - About 3 hrs to fix

                        Function _initReprPanel has 90 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        Menu.prototype._initReprPanel = function () {
                          const self = this
                          const reprList = $(
                            `${self._menuId} .panel-menu[data-panel-type=miew-menu-panel-representation] .miew-repr-list`
                          )
                        Severity: Major
                        Found in demo/src/scripts/ui/Menu.js - About 3 hrs to fix

                          Function _updateInfo has 79 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          Menu.prototype._updateInfo = function (dataSource) {
                            if (dataSource && dataSource.id !== 'Complex') {
                              return
                            }
                            const complex = dataSource
                          Severity: Major
                          Found in demo/src/scripts/ui/Menu.js - About 3 hrs to fix

                            Function _fillCombo has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            Menu.prototype._fillCombo = function (type, name, path, entityList) {
                              const self = this
                              const frag = document.createDocumentFragment()
                              let newItem
                            
                            
                            Severity: Major
                            Found in demo/src/scripts/ui/Menu.js - About 3 hrs to fix

                              Function _fillSelectionColorCombo has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              Menu.prototype._fillSelectionColorCombo = function (paletteID) {
                                const self = this
                                const frag = document.createDocumentFragment()
                                const palette = palettes.get(paletteID) || palettes.first
                                const colorList = palette.namedColorsArray
                              Severity: Major
                              Found in demo/src/scripts/ui/Menu.js - About 2 hrs to fix

                                Function Menu has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                function Menu(/** Node */ container, /** Miew */ viewer) {
                                  // Add proper DOM elements
                                  _.forEach($.parseHTML(menuHtml), (element) =>
                                    container.parentNode.appendChild(element)
                                  )
                                Severity: Major
                                Found in demo/src/scripts/ui/Menu.js - About 2 hrs to fix

                                  Function show has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  Menu.prototype.show = function (panelID, menuItem) {
                                    const self = this
                                  
                                    this.setBlur(true)
                                    this._titlebar.hide()
                                  Severity: Major
                                  Found in demo/src/scripts/ui/Menu.js - About 2 hrs to fix

                                    Function _copyCurReprListItem has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    Menu.prototype._copyCurReprListItem = function (index) {
                                      const self = this
                                      const reprList = $(
                                        `${self._menuId} .panel-menu[data-panel-type=miew-menu-panel-representation] .miew-repr-list`
                                      )
                                    Severity: Major
                                    Found in demo/src/scripts/ui/Menu.js - About 2 hrs to fix

                                      Function _initPresetsPanelActions has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      Menu.prototype._initPresetsPanelActions = function () {
                                        const self = this
                                      
                                        self.presetsPanel.actions.pdb.inputs.refresh =
                                          self._presetsPanelActionsPdbInputsRefresh // check input box?
                                      Severity: Major
                                      Found in demo/src/scripts/ui/Menu.js - About 2 hrs to fix

                                        Function _btnToolbarClick has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            function _btnToolbarClick() {
                                              if (this.classList.contains('disabled')) {
                                                return
                                              }
                                        
                                        
                                        Severity: Minor
                                        Found in demo/src/scripts/ui/Menu.js - About 1 hr to fix

                                          Function _updateReprList has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                                          Open

                                          Menu.prototype._updateReprList = function () {
                                            const self = this
                                          
                                            function _createOptionsFromMVData(index, property, element, itemId) {
                                              const curRep = self._viewer.repGet(index)
                                          Severity: Minor
                                          Found in demo/src/scripts/ui/Menu.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 _addReprListItem has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                                          Open

                                          Menu.prototype._addReprListItem = function (panel, index, repr) {
                                            const self = this
                                            const reprList = $(
                                              `${self._menuId} [data-panel-type=miew-menu-panel-representation] .miew-repr-list`
                                            )
                                          Severity: Minor
                                          Found in demo/src/scripts/ui/Menu.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 fillSingleWords has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                                          Open

                                            function fillSingleWords() {
                                              const frag = document.createDocumentFragment()
                                              let newItem
                                              const group = selectionPanel.find('[data-tab-content=singleword]').get(0)
                                              let i
                                          Severity: Minor
                                          Found in demo/src/scripts/ui/Menu.js - About 1 hr to fix

                                            Function _initMiewEventListeners has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                                            Open

                                            Menu.prototype._initMiewEventListeners = function () {
                                              const self = this
                                            
                                              this._viewer.addEventListener('loading', () => {
                                                self._setTitle('Loading…')
                                            Severity: Minor
                                            Found in demo/src/scripts/ui/Menu.js - About 1 hr to fix

                                              Function _term has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                                              Open

                                                  (command, term) => {
                                                    if (self._viewer) {
                                                      command = command.trim()
                                                      const loadStr = command.split(/\s+/)
                                              
                                              
                                              Severity: Minor
                                              Found in demo/src/scripts/ui/Menu.js - About 1 hr to fix

                                                Function _fillSourceList has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                                                Open

                                                Menu.prototype._fillSourceList = function () {
                                                  const self = this
                                                  const names = this._viewer.getVisuals()
                                                  $('#miew-source-dropdown').toggle(names.length > 1)
                                                
                                                
                                                Severity: Minor
                                                Found in demo/src/scripts/ui/Menu.js - About 1 hr to fix

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

                                                    function fillToolbar(type, name, option, entityList) {
                                                      const toolbar = $(`${self._menuId} [data-toolbar-type=${type}]`).get(0)
                                                      const list = entityList.all
                                                      for (let i = 0, n = list.length; i < n; i++) {
                                                        let entry = list[i]
                                                  Severity: Minor
                                                  Found in demo/src/scripts/ui/Menu.js - About 1 hr to fix

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

                                                    Menu.prototype._initRenderPanel = function () {
                                                      const self = this
                                                    
                                                      $(`${self._menuId} [data-toggle=resolution]`).on(
                                                        'click',
                                                    Severity: Minor
                                                    Found in demo/src/scripts/ui/Menu.js - About 1 hr to fix

                                                      Function _initLoadPanel has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                                      Open

                                                      Menu.prototype._initLoadPanel = function () {
                                                        const self = this
                                                      
                                                        $(
                                                          `${self._menuId} [data-form-type=miew-menu-form-load-pdb] [data-tooltip="tooltip"]`
                                                      Severity: Minor
                                                      Found in demo/src/scripts/ui/Menu.js - About 1 hr to fix

                                                        Function _initReprList has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                                        Open

                                                        Menu.prototype._initReprList = function () {
                                                          this._fillReprList()
                                                          this._curReprIdx = this._viewer.repCurrent()
                                                          $(
                                                            `${this._menuId} .panel-menu[data-panel-type=miew-menu-panel-representation] .miew-repr-list .panel.valid:eq(${this._curReprIdx}) .panel-heading`
                                                        Severity: Minor
                                                        Found in demo/src/scripts/ui/Menu.js - About 1 hr to fix

                                                          Function _initSelectionPanel has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                                          Open

                                                          Menu.prototype._initSelectionPanel = function () {
                                                            const self = this
                                                            const selectionPanel = $(
                                                              `${self._menuId} [data-panel-type=miew-menu-panel-selection]`
                                                            )
                                                          Severity: Minor
                                                          Found in demo/src/scripts/ui/Menu.js - About 55 mins 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 _fixKeyboard has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                                          Open

                                                          Menu.prototype._fixKeyboard = function () {
                                                            // do IFRAME related hack
                                                            if (window !== window.top) {
                                                              const parentDocument = window.top.document
                                                              let button = parentDocument.querySelector('button')
                                                          Severity: Minor
                                                          Found in demo/src/scripts/ui/Menu.js - About 45 mins 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 _updateInfo has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                                          Open

                                                          Menu.prototype._updateInfo = function (dataSource) {
                                                            if (dataSource && dataSource.id !== 'Complex') {
                                                              return
                                                            }
                                                            const complex = dataSource
                                                          Severity: Minor
                                                          Found in demo/src/scripts/ui/Menu.js - About 45 mins 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

                                                            $(`${self._menuId} [data-toggle="colorer-immediate"]`).each(
                                                              (index, element) => {
                                                                const id = element.getAttribute('data-value')
                                                                element.addEventListener('click', (event) => {
                                                                  $(
                                                          Severity: Major
                                                          Found in demo/src/scripts/ui/Menu.js and 1 other location - About 7 hrs to fix
                                                          demo/src/scripts/ui/Menu.js on lines 2358..2369

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

                                                          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

                                                            $(`${self._menuId} [data-toggle="mode-immediate"]`).each((index, element) => {
                                                              const id = element.getAttribute('data-value')
                                                              element.addEventListener('click', (event) => {
                                                                $(
                                                                  `${self._menuId} [data-value="${unarray(self._viewer.rep().mode)}"]`
                                                          Severity: Major
                                                          Found in demo/src/scripts/ui/Menu.js and 1 other location - About 7 hrs to fix
                                                          demo/src/scripts/ui/Menu.js on lines 2372..2387

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

                                                          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

                                                            reprList.find(`.panel:eq(${index}) .spinner-dec-btn`).on('click', (e) => {
                                                              const spinnerType = e.currentTarget.getAttribute('data-value')
                                                              const spinner = reprList.find(
                                                                `.panel:eq(${index}) [data-type=${spinnerType}]`
                                                              )
                                                          Severity: Major
                                                          Found in demo/src/scripts/ui/Menu.js and 1 other location - About 6 hrs to fix
                                                          demo/src/scripts/ui/Menu.js on lines 465..474

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

                                                          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

                                                            reprList.find(`.panel:eq(${index}) .spinner-inc-btn`).on('click', (e) => {
                                                              const spinnerType = e.currentTarget.getAttribute('data-value')
                                                              const spinner = reprList.find(
                                                                `.panel:eq(${index}) [data-type=${spinnerType}]`
                                                              )
                                                          Severity: Major
                                                          Found in demo/src/scripts/ui/Menu.js and 1 other location - About 6 hrs to fix
                                                          demo/src/scripts/ui/Menu.js on lines 454..463

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

                                                          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

                                                                    createElement(
                                                                      'li',
                                                                      {
                                                                        class: 'list-group-item col-xs-12 col-sm-12',
                                                                        'data-type': 'surf-param-rad'
                                                          Severity: Major
                                                          Found in demo/src/scripts/ui/Menu.js and 1 other location - About 5 hrs to fix
                                                          demo/src/scripts/ui/Menu.js on lines 775..813

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

                                                          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

                                                                    createElement(
                                                                      'li',
                                                                      {
                                                                        class: 'list-group-item col-xs-12 col-sm-12',
                                                                        'data-type': 'surf-param-iso'
                                                          Severity: Major
                                                          Found in demo/src/scripts/ui/Menu.js and 1 other location - About 5 hrs to fix
                                                          demo/src/scripts/ui/Menu.js on lines 736..774

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

                                                          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

                                                            reprList
                                                              .find(
                                                                `.panel:eq(${index}) [data-toggle=combobox-panel][data-value=miew-menu-panel-color]`
                                                              )
                                                              .on('click', function () {
                                                          Severity: Major
                                                          Found in demo/src/scripts/ui/Menu.js and 2 other locations - About 2 hrs to fix
                                                          demo/src/scripts/ui/Menu.js on lines 498..506
                                                          demo/src/scripts/ui/Menu.js on lines 508..518

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

                                                          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

                                                            reprList
                                                              .find(
                                                                `.panel:eq(${index}) [data-toggle=combobox-panel][data-value=miew-menu-panel-matpreset]`
                                                              )
                                                              .on('click', function () {
                                                          Severity: Major
                                                          Found in demo/src/scripts/ui/Menu.js and 2 other locations - About 2 hrs to fix
                                                          demo/src/scripts/ui/Menu.js on lines 487..497
                                                          demo/src/scripts/ui/Menu.js on lines 508..518

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

                                                          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

                                                            reprList
                                                              .find(
                                                                `.panel:eq(${index}) [data-toggle=combobox-panel][data-value=miew-menu-panel-select-color]`
                                                              )
                                                              .on('click', function () {
                                                          Severity: Major
                                                          Found in demo/src/scripts/ui/Menu.js and 2 other locations - About 2 hrs to fix
                                                          demo/src/scripts/ui/Menu.js on lines 487..497
                                                          demo/src/scripts/ui/Menu.js on lines 498..506

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

                                                          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

                                                            reprList
                                                              .find(`.panel:eq(${index}) .panel-heading .btn-visible`)
                                                              .on('click', () => {
                                                                reprList.find(`.panel:eq(${index}) .panel-heading .btn-visible`).hide()
                                                                reprList.find(`.panel:eq(${index}) .panel-heading .btn-invisible`).show()
                                                          Severity: Major
                                                          Found in demo/src/scripts/ui/Menu.js and 1 other location - About 2 hrs to fix
                                                          demo/src/scripts/ui/Menu.js on lines 421..426

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

                                                          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

                                                            reprList
                                                              .find(`.panel:eq(${index}) .panel-heading .btn-invisible`)
                                                              .on('click', () => {
                                                                reprList.find(`.panel:eq(${index}) .panel-heading .btn-invisible`).hide()
                                                                reprList.find(`.panel:eq(${index}) .panel-heading .btn-visible`).show()
                                                          Severity: Major
                                                          Found in demo/src/scripts/ui/Menu.js and 1 other location - About 2 hrs to fix
                                                          demo/src/scripts/ui/Menu.js on lines 414..419

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

                                                          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

                                                            ).on('click', () => {
                                                              let activeItem
                                                              if (type === 'miew-menu-panel-palette') {
                                                                activeItem = settings.get(path)
                                                              } else {
                                                          Severity: Major
                                                          Found in demo/src/scripts/ui/Menu.js and 1 other location - About 2 hrs to fix
                                                          demo/src/scripts/ui/Menu.js on lines 350..358

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

                                                          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

                                                              /** @this HTMLSelectElement */ () => {
                                                                let activeItem
                                                                if (type === 'miew-menu-panel-palette') {
                                                                  activeItem = settings.get(path)
                                                                } else {
                                                          Severity: Major
                                                          Found in demo/src/scripts/ui/Menu.js and 1 other location - About 2 hrs to fix
                                                          demo/src/scripts/ui/Menu.js on lines 363..371

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

                                                          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

                                                                    createElement(
                                                                      'li',
                                                                      {
                                                                        class: 'list-group-item col-xs-12 col-sm-12',
                                                                        'data-toggle': 'combobox-panel',
                                                          Severity: Major
                                                          Found in demo/src/scripts/ui/Menu.js and 2 other locations - About 2 hrs to fix
                                                          demo/src/scripts/ui/Menu.js on lines 633..656
                                                          demo/src/scripts/ui/Menu.js on lines 658..681

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

                                                          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

                                                                    createElement(
                                                                      'li',
                                                                      {
                                                                        class: 'list-group-item col-xs-12 col-sm-12',
                                                                        'data-toggle': 'combobox-panel',
                                                          Severity: Major
                                                          Found in demo/src/scripts/ui/Menu.js and 2 other locations - About 2 hrs to fix
                                                          demo/src/scripts/ui/Menu.js on lines 633..656
                                                          demo/src/scripts/ui/Menu.js on lines 712..735

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

                                                          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

                                                                    createElement(
                                                                      'li',
                                                                      {
                                                                        class: 'list-group-item col-xs-12 col-sm-12',
                                                                        'data-toggle': 'combobox-panel',
                                                          Severity: Major
                                                          Found in demo/src/scripts/ui/Menu.js and 2 other locations - About 2 hrs to fix
                                                          demo/src/scripts/ui/Menu.js on lines 658..681
                                                          demo/src/scripts/ui/Menu.js on lines 712..735

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

                                                          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

                                                                    const onLogMessage = function (e) {
                                                                      const msg = e.message.replaceAll('[', '(').replaceAll(']', ')') // temp workaround for https://github.com/jcubic/jquery.terminal/issues/470
                                                                      term.echo(`[[b;${colors[e.level] || '#666'};]${msg}]`)
                                                                    }
                                                          Severity: Major
                                                          Found in demo/src/scripts/ui/Menu.js and 1 other location - About 2 hrs to fix
                                                          packages/miew-app/src/components/menu/terminal/Terminal.jsx on lines 25..28

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

                                                          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

                                                              for (let i = 0, n = self._keyWordsPrimary.length; i < n; i++) {
                                                                const wordPrimary = self._keyWordsPrimary[i]
                                                                newItem = createElement(
                                                                  'a',
                                                                  {
                                                          Severity: Major
                                                          Found in demo/src/scripts/ui/Menu.js and 1 other location - About 1 hr to fix
                                                          demo/src/scripts/ui/Menu.js on lines 2110..2123

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

                                                          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

                                                              for (i = 0, n = self._singleWordsPrimary.length; i < n; i++) {
                                                                const wordPrimary = self._singleWordsPrimary[i]
                                                                newItem = createElement(
                                                                  'a',
                                                                  {
                                                          Severity: Major
                                                          Found in demo/src/scripts/ui/Menu.js and 1 other location - About 1 hr to fix
                                                          demo/src/scripts/ui/Menu.js on lines 2151..2164

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

                                                          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 ('scale' in repr.mode.opts && repr.mode.opts.scale !== radScale) {
                                                                repr.mode.opts.scale = radScale
                                                                repr.needsRebuild = true
                                                              }
                                                          Severity: Major
                                                          Found in demo/src/scripts/ui/Menu.js and 1 other location - About 1 hr to fix
                                                          demo/src/scripts/ui/Menu.js on lines 2828..2831

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

                                                          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 ('zClip' in repr.mode.opts && repr.mode.opts.zClip !== zClip) {
                                                                repr.mode.opts.zClip = zClip
                                                                repr.needsRebuild = true
                                                              }
                                                          Severity: Major
                                                          Found in demo/src/scripts/ui/Menu.js and 1 other location - About 1 hr to fix
                                                          demo/src/scripts/ui/Menu.js on lines 2834..2837

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

                                                          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

                                                            const displayFormError = function (error) {
                                                              if (error) {
                                                                mainErrorAlert.html(error)
                                                                mainErrorAlert.removeClass('hidden')
                                                              } else {
                                                          Severity: Major
                                                          Found in demo/src/scripts/ui/Menu.js and 1 other location - About 1 hr to fix
                                                          demo/src/scripts/ui/Menu.js on lines 1724..1732

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

                                                          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

                                                            const displayFormWarning = function (warning) {
                                                              if (warning) {
                                                                mainWarningAlert.html(warning)
                                                                mainWarningAlert.removeClass('hidden')
                                                              } else {
                                                          Severity: Major
                                                          Found in demo/src/scripts/ui/Menu.js and 1 other location - About 1 hr to fix
                                                          demo/src/scripts/ui/Menu.js on lines 1715..1723

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

                                                          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 (parseFloat(spinner.attr('min')) > parseFloat(spinner.val())) {
                                                                spinner.val(parseFloat(spinner.attr('min')))
                                                                spinner.change()
                                                              }
                                                          Severity: Major
                                                          Found in demo/src/scripts/ui/Menu.js and 1 other location - About 1 hr to fix
                                                          demo/src/scripts/ui/Menu.js on lines 448..451

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

                                                          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 (parseFloat(spinner.attr('max')) < parseFloat(spinner.val())) {
                                                                spinner.val(parseFloat(spinner.attr('max')))
                                                                spinner.change()
                                                              }
                                                          Severity: Major
                                                          Found in demo/src/scripts/ui/Menu.js and 1 other location - About 1 hr to fix
                                                          demo/src/scripts/ui/Menu.js on lines 444..447

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

                                                          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 (this.classList.contains('active') === true) {
                                                                    resSelector.addClass('active')
                                                                  } else {
                                                                    resSelector.removeClass('active')
                                                                  }
                                                          Severity: Minor
                                                          Found in demo/src/scripts/ui/Menu.js and 1 other location - About 40 mins to fix
                                                          demo/src/scripts/ui/Menu.js on lines 1381..1385

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

                                                          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 (itemID === 'QS' || itemID === 'CS') {
                                                                  isoParam.show()
                                                                  isoParam
                                                                    .find('[data-type=iso]')
                                                                    .val(settings.defaults.modes[itemID].isoValue)
                                                          Severity: Minor
                                                          Found in demo/src/scripts/ui/Menu.js and 1 other location - About 40 mins to fix
                                                          demo/src/scripts/ui/Menu.js on lines 1133..1140

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

                                                          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 (itemID === 'QS') {
                                                                  radParam.show()
                                                                  radParam
                                                                    .find('[data-type=rad]')
                                                                    .val(settings.defaults.modes[itemID].scale)
                                                          Severity: Minor
                                                          Found in demo/src/scripts/ui/Menu.js and 1 other location - About 40 mins to fix
                                                          demo/src/scripts/ui/Menu.js on lines 1121..1128

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

                                                          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 (this.classList.contains('active') === true) {
                                                                      selector.addClass('active')
                                                                    } else {
                                                                      selector.removeClass('active')
                                                                    }
                                                          Severity: Minor
                                                          Found in demo/src/scripts/ui/Menu.js and 1 other location - About 40 mins to fix
                                                          demo/src/scripts/ui/Menu.js on lines 1362..1366

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

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

                                                          function getAltLocNames(viewer) {
                                                            const visual = viewer._getComplexVisual()
                                                            return visual ? visual.getComplex().getAltLocNames() : 0
                                                          }
                                                          Severity: Major
                                                          Found in demo/src/scripts/ui/Menu.js and 4 other locations - About 35 mins to fix
                                                          demo/src/scripts/ui/Menu.js on lines 2072..2075
                                                          demo/src/scripts/ui/Menu.js on lines 2077..2080
                                                          demo/src/scripts/ui/Menu.js on lines 2082..2085
                                                          demo/src/scripts/ui/Menu.js on lines 2087..2090

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

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

                                                          function getElements(viewer) {
                                                            const visual = viewer._getComplexVisual()
                                                            return visual ? visual.getComplex().getElements() : 0
                                                          }
                                                          Severity: Major
                                                          Found in demo/src/scripts/ui/Menu.js and 4 other locations - About 35 mins to fix
                                                          demo/src/scripts/ui/Menu.js on lines 2072..2075
                                                          demo/src/scripts/ui/Menu.js on lines 2082..2085
                                                          demo/src/scripts/ui/Menu.js on lines 2087..2090
                                                          demo/src/scripts/ui/Menu.js on lines 2092..2095

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

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

                                                          function getAtomNames(viewer) {
                                                            const visual = viewer._getComplexVisual()
                                                            return visual ? visual.getComplex().getAtomNames() : 0
                                                          }
                                                          Severity: Major
                                                          Found in demo/src/scripts/ui/Menu.js and 4 other locations - About 35 mins to fix
                                                          demo/src/scripts/ui/Menu.js on lines 2077..2080
                                                          demo/src/scripts/ui/Menu.js on lines 2082..2085
                                                          demo/src/scripts/ui/Menu.js on lines 2087..2090
                                                          demo/src/scripts/ui/Menu.js on lines 2092..2095

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

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

                                                          function getChainNames(viewer) {
                                                            const visual = viewer._getComplexVisual()
                                                            return visual ? visual.getComplex().getChainNames() : 0
                                                          }
                                                          Severity: Major
                                                          Found in demo/src/scripts/ui/Menu.js and 4 other locations - About 35 mins to fix
                                                          demo/src/scripts/ui/Menu.js on lines 2072..2075
                                                          demo/src/scripts/ui/Menu.js on lines 2077..2080
                                                          demo/src/scripts/ui/Menu.js on lines 2082..2085
                                                          demo/src/scripts/ui/Menu.js on lines 2092..2095

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

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

                                                          function getResidueNames(viewer) {
                                                            const visual = viewer._getComplexVisual()
                                                            return visual ? visual.getComplex().getResidueNames() : 0
                                                          }
                                                          Severity: Major
                                                          Found in demo/src/scripts/ui/Menu.js and 4 other locations - About 35 mins to fix
                                                          demo/src/scripts/ui/Menu.js on lines 2072..2075
                                                          demo/src/scripts/ui/Menu.js on lines 2077..2080
                                                          demo/src/scripts/ui/Menu.js on lines 2087..2090
                                                          demo/src/scripts/ui/Menu.js on lines 2092..2095

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

                                                          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 (self.presetsPanel.inputs.isCorrect) {
                                                                loadPdbButton.removeClass('disabled')
                                                              } else {
                                                                loadPdbButton.addClass('disabled')
                                                              }
                                                          Severity: Minor
                                                          Found in demo/src/scripts/ui/Menu.js and 1 other location - About 30 mins to fix
                                                          demo/src/scripts/ui/Menu.js on lines 1781..1785

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

                                                          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 (self.presetsPanel.inputs.main) {
                                                                clearInputsButton.removeClass('hidden')
                                                              } else {
                                                                clearInputsButton.addClass('hidden')
                                                              }
                                                          Severity: Minor
                                                          Found in demo/src/scripts/ui/Menu.js and 1 other location - About 30 mins to fix
                                                          demo/src/scripts/ui/Menu.js on lines 1776..1780

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

                                                          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

                                                          There are no issues that match your filters.

                                                          Category
                                                          Status