SpeciesFileGroup/taxonworks

View on GitHub

Showing 12,579 of 12,579 total issues

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

function points(size) {
  return [...Array(7)]
    .map((_, i) => {
      const angleDeg = 60 * i - 30
      const angleRad = (Math.PI / 180) * angleDeg
Severity: Major
Found in app/javascript/vue/components/ui/VGraph/svg/hexagon.js and 2 other locations - About 5 hrs to fix
app/javascript/vue/components/ui/VGraph/svg/octagon.js on lines 16..29
app/javascript/vue/components/ui/VGraph/svg/pentagon.js on lines 19..32

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

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

Method has too many lines. [57/25]
Open

  def data_models
    allowed= %w{
      AlternateValue
      BiologicalAssociationsGraph
      BiologicalRelationship

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Function init has 133 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  init: function() {
  var
      animationTime = 250;

  function showAll() {
Severity: Major
Found in app/assets/javascripts/views/shared/lists.js - About 5 hrs to fix

    File useGraph.js has 388 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import { reactive, computed, toRefs } from 'vue'
    import {
      BiologicalAssociation,
      BiologicalAssociationGraph,
      Citation

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

      export default function (observationData) {
        const observation = makeBaseObservation(observationData)
        return Object.assign(observation, {
          n: observationData.sample_n || null,
          min: observationData.sample_min || null,
      app/javascript/vue/tasks/observation_matrices/matrix_column_coder/helpers/makeSampleObservation.js on lines 3..15

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

      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

      export default function (observationData) {
        const observation = makeBaseObservation(observationData)
        return Object.assign(observation, {
          n: observationData.sample_n || null,
          min: observationData.sample_min || null,
      app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/helpers/makeSampleObservation.js on lines 3..15

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

      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

      Method has too many lines. [56/25]
      Open

        def self.gpx_to_csv(gpx_file, csv_options = {col_sep: "\t", headers: true, encoding: 'UTF-8', write_headers: true})
          gpx_headers = %w(name geojson start_date end_date minimum_elevation maximum_elevation)
      
          csv_string = CSV.generate(**csv_options) do |csv|
            csv << gpx_headers
      Severity: Minor
      Found in lib/vendor/gpx_to_csv.rb by rubocop

      This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

      Class Autocomplete has 39 methods (exceeds 20 allowed). Consider refactoring.
      Open

        class Query::Autocomplete < Queries::Query
      
          include Arel::Nodes
      
          include Queries::Concerns::Identifiers
      Severity: Minor
      Found in lib/queries/query/autocomplete.rb - About 5 hrs to fix

        Class Result has 39 methods (exceeds 20 allowed). Consider refactoring.
        Open

            class Result
              # query string
              attr_accessor :name
        
              # how to match
        Severity: Minor
        Found in lib/vendor/biodiversity.rb - About 5 hrs to fix

          Method has too many lines. [55/25]
          Open

            def self.generate(otus, project_members, reference_csv = nil )
              ::CSV.generate(col_sep: "\t") do |csv|
          
                csv << %w{
                  ID

          This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

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

          export default function (state, args) {
            const {
              rowObjectId,
              rowObjectType,
              description
          app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setPresence.js on lines 4..18

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 138.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

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

          export default function (state, args) {
            const {
              rowObjectId,
              rowObjectType,
              isChecked
          app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setFreeTextValue.js on lines 4..18

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 138.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Method using_iccn_class has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
          Open

            def using_iccn_class
              unless identifier.nil?
                lccn = identifier
          
                # '200112345', '2010549727', '2003064850', '|a  2003064850', '88156495', '68-004897', '2001-459440'
          Severity: Minor
          Found in app/models/identifier/global/lccn.rb - 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 handleEvents has 127 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          FilterHub.prototype.handleEvents = function (that) {
            const elements = [...document.querySelectorAll('#task_carrousel')]
          
            that.arrayTasks = elements.map(
              (element) =>
          Severity: Major
          Found in app/assets/javascripts/views/hub/filterHub.js - About 5 hrs to fix

            Method has too many lines. [54/25]
            Open

                def build_sequence_relationships
                  @total_data_lines = 0
                  i = 0
                  gene_descriptors = {}
                  gene_attributes = {}

            This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

            Method has too many lines. [54/25]
            Open

                def self.significant_digits(number_string)
                  # is there a decimal point?
                  intg = ''
                  decimal_point_zeros = ''
                  mantissa = ''
            Severity: Minor
            Found in lib/utilities/geo.rb by rubocop

            This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

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

              bind_hover: function (form) {
                var hiConfig = {
                  sensitivity: 3, // number = sensitivity threshold (must be 1 or higher)
                  interval: 400, // number = milliseconds for onMouseOver polling interval
                  timeout: 200, // number = milliseconds delay before onMouseOut
            Severity: Major
            Found in app/assets/javascripts/views/confidences/form.js and 1 other location - About 5 hrs to fix
            app/assets/javascripts/views/filter/_area_picker.js on lines 44..59

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

            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

              bind_hover: function (form) {
                var hiConfig = {
                  sensitivity: 3, // number = sensitivity threshold (must be 1 or higher)
                  interval: 400,  // number = milliseconds for onMouseOver polling interval
                  timeout: 200,   // number = milliseconds delay before onMouseOut
            Severity: Major
            Found in app/assets/javascripts/views/filter/_area_picker.js and 1 other location - About 5 hrs to fix
            app/assets/javascripts/views/confidences/form.js on lines 53..68

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

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

            const MutationFunctions = {
              [MutationNames.AddDocumentation]: addDocumentation,
              [MutationNames.SetDocumentation]: setDocumentation,
              [MutationNames.SetType]: setType,
              [MutationNames.SetVerbatim]: setVerbatim,
            app/javascript/vue/tasks/collecting_events/new_collecting_event/store/mutations/mutations.js on lines 33..48
            app/javascript/vue/tasks/extracts/new_extract/store/actions/actions.js on lines 18..33
            app/javascript/vue/tasks/extracts/new_extract/store/getters/getters.js on lines 33..48
            app/javascript/vue/tasks/observation_matrices/image/store/mutations/mutations.js on lines 33..48
            app/javascript/vue/tasks/otu/browse/store/actions/actions.js on lines 17..32
            app/javascript/vue/tasks/sources/new_source/store/getters/getters.js on lines 33..48

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

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

            const MutationFunctions = {
              [MutationNames.AddDepiction]: addDepiction,
              [MutationNames.AddNewColumn]: addNewColumn,
              [MutationNames.SetObservationMatrix]: setObservationMatrix,
              [MutationNames.SetObservations]: setObservations,
            app/javascript/vue/tasks/collecting_events/new_collecting_event/store/mutations/mutations.js on lines 33..48
            app/javascript/vue/tasks/extracts/new_extract/store/actions/actions.js on lines 18..33
            app/javascript/vue/tasks/extracts/new_extract/store/getters/getters.js on lines 33..48
            app/javascript/vue/tasks/otu/browse/store/actions/actions.js on lines 17..32
            app/javascript/vue/tasks/sources/new_source/store/getters/getters.js on lines 33..48
            app/javascript/vue/tasks/sources/new_source/store/mutations/mutations.js on lines 33..48

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

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Severity
            Category
            Status
            Source
            Language