SpeciesFileGroup/taxonworks

View on GitHub

Showing 732 of 12,572 total issues

Avoid too many return statements within this function.
Open

    return asc ? result : -result
Severity: Major
Found in app/javascript/vue/helpers/arrays.js - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

        return [a, original_relationships]
    Severity: Major
    Found in app/models/protonym/becomes.rb - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

          return false unless original_relationships = becomes_test_for_original_relationships
      Severity: Major
      Found in app/models/protonym/becomes.rb - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                return 'Occurrence'
        Severity: Major
        Found in app/models/dwc_occurrence.rb - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

              return false unless becomes_test_for_other_relationships
          Severity: Major
          Found in app/models/protonym/becomes.rb - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                return nil
            Severity: Major
            Found in app/models/taxon_name_classification.rb - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                      return {}
              Severity: Major
              Found in lib/utilities/dates.rb - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                      return {} if coordinates[:long_sec].to_f >= 60
                Severity: Major
                Found in lib/utilities/geo.rb - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                          return date
                  Severity: Major
                  Found in lib/utilities/dates.rb - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                          return c
                    Severity: Major
                    Found in lib/utilities/geo.rb - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                              return date
                      Severity: Major
                      Found in lib/utilities/dates.rb - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                return false
                        Severity: Major
                        Found in lib/catalog/nomenclature/entry.rb - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                return {} if coordinates[:long_deg].to_f > 180 || coordinates[:long_deg].to_f < -180
                          Severity: Major
                          Found in lib/utilities/geo.rb - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                    return {}
                            Severity: Major
                            Found in lib/utilities/dates.rb - About 30 mins to fix

                              Avoid too many return statements within this method.
                              Open

                                    return {} if coordinates[:lat_sec].to_f >= 60
                              Severity: Major
                              Found in lib/utilities/geo.rb - About 30 mins to fix

                                Avoid too many return statements within this method.
                                Open

                                      return {}
                                Severity: Major
                                Found in lib/utilities/dates.rb - About 30 mins to fix

                                  Avoid too many return statements within this method.
                                  Open

                                        return {} if coordinates[:long_min].to_f >= 60
                                  Severity: Major
                                  Found in lib/utilities/geo.rb - About 30 mins to fix

                                    Function addToArray has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                    function addToArray(arr, obj, opts = {}) {
                                      const { property = 'id', prepend = false, primitive = false } = opts
                                    
                                      const index = primitive
                                        ? arr.findIndex((item) => obj === item)
                                    Severity: Minor
                                    Found in app/javascript/vue/helpers/arrays.js - About 25 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 default has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                    export default function (observationData) {
                                      if (observationData.type === ObservationTypes.Qualitative) {
                                        return makeQualitativeObservation(observationData)
                                      } else if (observationData.type === ObservationTypes.Continuous) {
                                        return makeContinuousObservation(observationData)

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

                                      start () {
                                        this.update()
                                    
                                        this.intervalId = setInterval(() => {
                                          if (!this.isPaused) {
                                    Severity: Minor
                                    Found in app/javascript/vue/tasks/dwc/dashboard/components/Countdown/countdown.js - About 25 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

                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language