Showing 306 of 628 total issues
Function link
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
link: function(scope, $element, attr, ctrl, $transclude) {
Function beforeSetClass
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
beforeSetClass: function(element, add, remove, animationCompleted, options) {
Function appendTextArea
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function appendTextArea(id, placeholder, div, isRequired, invalidMessage) {
Function appendField
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function appendField(id, text, div, isRequired, invalidMessage) {
Function AjaxAction
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
var AjaxAction = function(httpMethod, operation, path, isLongOperation, params) {
Function get_annotations
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function get_annotations() {
jQuery("#results_error").html("");
jQuery("#annotator_error").html("");
// Validation
- 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 check_params_ontologies
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def check_params_ontologies(params)
params[:ontologies] ||= params[:id]
if params[:ontologies]
if params[:ontologies].include?(",")
params[:ontologies] = params[:ontologies].split(",")
- 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 check_delete_mapping_permission
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def check_delete_mapping_permission(mappings)
# ensure mappings is an Array of mappings (some calls may provide only a single mapping instance)
mappings = [mappings] if mappings.instance_of? LinkedData::Client::Models::Mapping
return false if mappings.all? {|m| m.id.to_s.empty?}
delete_mapping_permission = 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 _process_errors
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _process_errors(errors, response, remove_trailing_comma = true)
if errors.is_a?(Hash)
errors.each do |_, v|
if v.is_a?(Array)
response[:errors] += v.join(', ')
- 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 create
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def create
# Make the contacts an array
params[:submission][:contact] = params[:submission][:contact].values
params[:submission][:naturalLanguage].compact_blank!
- 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 ajax_process_cls
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
var ajax_process_cls = function() {
// Check on whether to stop the ajax process
if( ajax_cls_array.length === 0 ){
ajax_process_cls_halt();
return true;
- 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 simplify_class_model
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def simplify_class_model(cls_model)
# Simplify the class required required by the UI.
# No modification of the class ontology here, see simplify_classes.
# Default simple class model
cls = { :id => nil, :ontology => nil, :prefLabel => nil, :uri => nil, :ui => nil, :obsolete => 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 submission_status2string
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def submission_status2string(sub)
# Massage the submission status into a UI string
# submission status values, from:
# https://github.com/ncbo/ontologies_linked_data/blob/master/lib/ontologies_linked_data/models/submission_status.rb
# "UPLOADED", "RDF", "RDF_LABELS", "INDEXED", "METRICS", "ANNOTATOR", "ARCHIVED" and 'ERROR_*' for each.
- 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 subscribe_ontology_button
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def subscribe_ontology_button(ontology_id, user = nil)
user = session[:user] if user.nil?
if user.nil?
# subscribe button must redirect to login
return sanitize("<a href='/login?redirect=#{request.url}' style='font-size: .9em;' class='subscribe_to_ontology'>Subscribe</a>")
- 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 classes
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def classes
get_class(params)
if ["application/ld+json", "application/json"].include?(request.accept)
render plain: @concept.to_jsonld, content_type: request.accept and return
- 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 create
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def create
if params[:type].eql?('reply')
note = LinkedData::Client::Models::Reply.new(values: note_params)
elsif params[:type].eql?('ontology')
params[:relatedOntology] = [params.delete(:parent)]
- 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
Avoid too many return
statements within this function. Open
return true;
Avoid too many return
statements within this function. Open
return false;
Avoid too many return
statements within this function. Open
return data == d;
Avoid too many return
statements within this function. Open
if (pivotElem === elem) return pivot