Showing 12,631 of 12,631 total issues
Method has too many lines. [30/25] Open
def sv_fix_add_nominotypical_sub
return false if list_of_coordinated_names.collect{|r| r.id}.include?(parent_id)
rank = rank_string
p = self.parent
prank = p.rank_string
- Read upRead up
- Exclude checks
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. [30/25] Open
def source_citation_totals(sources)
data = {}
max_total = 0
Citation.related_klasses.each do |k|
- Read upRead up
- Exclude checks
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. [30/25] Open
def observation_params
params.require(:observation).permit(
:character_state_id, :frequency,
:continuous_value, :continuous_unit,
:day_made,
- Read upRead up
- Exclude checks
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. [30/25] Open
def field_occurrence_params
params.require(:field_occurrence).permit(
:total, :is_absent,
:ranged_lot_category_id,
:collecting_event_id,
- Read upRead up
- Exclude checks
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. [30/25] Open
def self.generate(otus, project_members, reference_csv = nil )
::CSV.generate(col_sep: "\t") do |csv|
csv << %w{
nameID
- Read upRead up
- Exclude checks
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. [30/25] Open
def create
@create_attempted = true
if ready_to_create?
# TODO: DRY
- Read upRead up
- Exclude checks
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. [30/25] Open
def self.generate(otus, project_members, reference_csv = nil )
::CSV.generate(col_sep: "\t") do |csv|
csv << %w{
taxonID
- Read upRead up
- Exclude checks
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. [30/25] Open
def self.generate(otus, project_members, reference_csv = nil )
::CSV.generate(col_sep: "\t") do |csv|
# TODO: Biocuration attributes on these two
# sex
- Read upRead up
- Exclude checks
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. [30/25] Open
def self.elevation_regex_from_verbatim_label(text)
text = ' ' + text.downcase.squish + ' '
elevation = {}
if (matchdata1 = text.match(/\D(\d*,?\d+)\s?[-–]\s?(\d*,?\d+) ?(m|ft|feet|meters)\.?\W/))
- Read upRead up
- Exclude checks
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. [30/25] Open
def initialize(
observation_matrix_id: nil,
project_id: nil,
language_id: nil,
keyword_ids: nil,
- Read upRead up
- Exclude checks
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.
File sources_controller.rb
has 260 lines of code (exceeds 250 allowed). Consider refactoring. Open
class SourcesController < ApplicationController
include DataControllerConfiguration::SharedDataControllerConfiguration
before_action :set_source, only: [:show, :edit, :update, :destroy, :clone, :api_show]
after_action -> { set_pagination_headers(:sources) }, only: [:index, :api_index ], if: :json_request?
Method gpx_to_csv
has 56 lines of code (exceeds 25 allowed). Consider refactoring. 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
Method degrees_minutes_seconds_to_decimal_degrees
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.degrees_minutes_seconds_to_decimal_degrees(dms_in) # rubocop:disable Metrics/PerceivedComplexity !! But this is too complex :)
match_string = nil
# no_point = false
degrees = 0.0
minutes = 0.0
Function makeInitialState
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
function makeInitialState() {
return {
settings: {
saving: false,
lock: {
Method generate
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.generate(otus, project_members, reference_csv = nil )
::CSV.generate(col_sep: "\t") do |csv|
csv << %w{
ID
Identical blocks of code found in 2 locations. Consider refactoring. Open
export default (shape, type = 'Georeference::Leaflet') => ({
tmpId: Math.random().toString(36).substr(2, 5),
geographic_item_attributes: { shape: JSON.stringify(shape) },
error_radius: shape.properties?.radius,
type: type
- Read upRead up
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 79.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
export default (shape, type = 'Georeference::Leaflet') => ({
tmpId: Math.random().toString(36).substr(2, 5),
geographic_item_attributes: { shape: JSON.stringify(shape) },
error_radius: shape.properties?.radius,
type: type
- Read upRead up
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 79.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
File layouts.js
has 257 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
COLLECTING_EVENT_PROPERTIES,
COLLECTION_OBJECT_PROPERTIES,
DWC_OCCURRENCE_PROPERTIES,
REPOSITORY_PROPERTIES,
Class SequencesController
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class SequencesController < ApplicationController
include DataControllerConfiguration::ProjectDataControllerConfiguration
before_action :set_sequence, only: [:show, :edit, :update, :destroy]
Class ControlledVocabularyTermsController
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class ControlledVocabularyTermsController < ApplicationController
include DataControllerConfiguration::ProjectDataControllerConfiguration
before_action :set_controlled_vocabulary_term, only: [:show, :edit, :update, :destroy, :depictions, :citations, :confidences, :api_show]