Showing 740 of 12,584 total issues
Method generate
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def self.generate(otus, project_members, reference_csv = nil )
::CSV.generate(col_sep: "\t") do |csv|
csv << %w{
nameID
- Read upRead up
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
Method define
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def self.define(*args, &block)
task_number = @@task_number += 1
task_sym = "__LOGGED_ROOT_TASK_DETECTOR_#{task_number}".to_sym
- Read upRead up
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
Method autocomplete
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def autocomplete
# [ query, order by use if true- don't if nil ]
queries = [
[ autocomplete_exact_id, false],
- Read upRead up
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
Method subject_object_scope
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def subject_object_scope(subject_query, object_query, target = 'Otu')
a = subject_query
b = object_query
a_sql, b_sql = nil, nil
- Read upRead up
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
Method topic_year_metadata
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def self.topic_year_metadata(entry_item_list)
h = {}
entry_item_list.each do |i|
y = i.nomenclature_date&.year
y ||= 'unknown'
- Read upRead up
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
Method to_s
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def to_s
d = data
str = ''
d.keys.sort{|a,b| (a || 'zzz') <=> (b || 'zzz')}.each do |c|
- Read upRead up
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 cleanPinboardItems
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
cleanPinboardItems({ type, section }) {
const CSRFToken = document
.querySelector('meta[name="csrf-token"]')
.getAttribute('content')
const headers = { 'X-CSRF-Token': CSRFToken }
Function default
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function (state, observation) {
if (!observation.type) { throw `Observations must have a type!` }
if (Object.keys(ObservationTypes).findIndex(typeKey => ObservationTypes[typeKey] === observation.type) === -1) { throw `Observations must have a valid type! Given ${observation.type}` }
Function loadAttributes
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function loadAttributes(params) {
const request = ajaxCall(
'get',
'/tasks/data_attributes/field_synchronize/values',
{
Function initialize_citation_topic_autocomplete
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function initialize_citation_topic_autocomplete(form) {
var autocomplete_input = form.find(".citation_topic_autocomplete");
autocomplete_input.autocomplete({
source: '/topics/lookup_topic',
Function openSlideoutPanel
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
openSlideoutPanel: function (panel) {
if ($(panel).hasClass('slide-left')) {
$(panel).css('right', '')
if ($(panel).css('left') != '0px') {
if ($(panel).attr('data-panel-position') == 'relative') {
Function mx_field_observer
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.fn.mx_field_observer = function() {
if (!this.length) { return this; }
return this.each(function() {
Function singleDrawnFeatureToMapListeners
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
singleDrawnFeatureToMapListeners: function (this_map, map_item, feature_control) {
google.maps.event.addListener(this_map[1], 'overlaycomplete', function (event) {
// Remove the last created shape if it exists.
if (map_item != null) {
if (map_item[0] != null) {
Method sv_species_gender_agreement
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def sv_species_gender_agreement
if is_species_rank?
s = part_of_speech_name
if !s.nil? && is_available?
if %w{adjective participle}.include?(s)
Method code_column
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.code_column(observation_matrix_column_id, observation_params)
c = ObservationMatrixColumn.find(observation_matrix_column_id)
o = ObservationMatrix.find(c.observation_matrix_id)
descriptor = c.descriptor
Method observation_export_value
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def observation_export_value(observation)
case observation.type
when 'Observation::Qualitative'
LABEL_REPLACEMENT[observation.character_state.label].nil? ? observation.character_state.label : LABEL_REPLACEMENT[observation.character_state.label]
when 'Observation::PresenceAbsence'
Method initialize
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(query_params)
super
@collectors = boolean_param(params, :collectors )
@collecting_event_id = params[:collecting_event_id]
Method sessions
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.sessions(records)
return [] if records.none?
r = records.to_a
Function bind_radio_buttons
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
bind_radio_buttons: function () { // for regex match table
$('.select_dates').click(function () {
// selector not working
var start_date = $(this).parent().parent('.extract_row').children('.start_date_value').text();
var end_date = $(this).parent().parent('.extract_row').children('.end_date_value').text();
Function init
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
init: function () {
var nodeChecked;
var that = this;
document.querySelectorAll('input[name=source\\[type\\]]').forEach(node => {