Showing 219 of 2,584 total issues
Function ListPagination
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ListPagination = props => {
if (props.articlesCount <= 10) {
return null;
}
- Create a ticketCreate a ticket
Method build_instrument
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.build_instrument(doc, options= {}, instrument_importer=nil)
save = defined?(options[:save]) ? true : options[:save]
duplicate = defined?(options[:duplicate]) ? :do_nothing : options[:duplicate]
i = ::Instrument.new
- Create a ticketCreate a ticket
Method run
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run(dataset)
documents = Document.where(item: dataset).order(created_at: :asc)
unless documents.empty?
document = documents.first
@doc = Nokogiri::XML document.file_contents
- Create a ticketCreate a ticket
Function ObjectFinder
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ObjectFinder = (instrumentId, type, id) => {
const sequences = useSelector(state => state.cc_sequences);
const cc_sequences = get(sequences, instrumentId, {})
const statements = useSelector(state => state.cc_statements);
const cc_statements = get(statements, instrumentId, {})
- Create a ticketCreate a ticket
Function ObjectFinder
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ObjectFinder = (instrumentId, type, id) => {
const sequences = useSelector(state => state.cc_sequences);
const cc_sequences = get(sequences, instrumentId, {})
const statements = useSelector(state => state.cc_statements);
const cc_statements = get(statements, instrumentId, {})
- Create a ticketCreate a ticket
Function AdminInstrumentImportMappingView
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
const AdminInstrumentImportMappingView = (props) => {
const dispatch = useDispatch()
const instrumentId = get(props, "match.params.instrumentId", "")
const importMappingId = get(props, "match.params.id", "")
- Create a ticketCreate a ticket
Function AdminDatasetImportMappingView
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
const AdminDatasetImportMappingView = (props) => {
const dispatch = useDispatch()
const datasetId = get(props, "match.params.datasetId", "")
const importMappingId = get(props, "match.params.id", "")
- Create a ticketCreate a ticket
Method no_circular_references
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def no_circular_references
if parent_id.present?
sql = <<-SQL
WITH RECURSIVE ancestry_check AS (
SELECT
- Create a ticketCreate a ticket
Method V3_2
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def V3_2(qitem_id)
@klass = ::QuestionItem
super do |qitem, qi|
build_response_domain = lambda do |rd|
- Create a ticketCreate a ticket
Method update
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def update
self.resource = resource_class.reset_password_by_token(resource_params)
yield resource if block_given?
if resource.errors.empty?
- Read upRead up
- Create a ticketCreate a ticket
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_categories
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def create_categories(categories=[])
categories.reverse.each do | category_hash |
urn = category_hash.fetch(:urn, '')
parsed_urn = parse_urn(urn)
if @instrument.prefix != parsed_urn[:instrument_prefix]
- Read upRead up
- Create a ticketCreate a ticket
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 run
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def run(dataset)
documents = Document.where(item: dataset).order(created_at: :asc)
unless documents.empty?
document = documents.first
@doc = Nokogiri::XML document.file_contents
- Read upRead up
- Create a ticketCreate a ticket
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 AdminUsers
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
const AdminUsers = () => {
const dispatch = useDispatch()
const deleteUser = (instrumentId) => {
- Create a ticketCreate a ticket
Function InstrumentBuildResponseDomains
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
const InstrumentBuildResponseDomains = (props) => {
const dispatch = useDispatch()
const instrumentId = get(props, "match.params.instrument_id", "")
const responseDomainId = get(props, "match.params.responseDomainId", null)
const responseDomainType = get(props, "match.params.responseDomainType", null)
- Create a ticketCreate a ticket
Method import
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def import(options = {})
cc_question_ids_to_delete = @object.cc_questions.pluck(:id)
set_import_to_running
@doc.each do |control_construct_scheme, q, t|
log :input, "#{control_construct_scheme},#{q},#{t}"
- Create a ticketCreate a ticket
Function InstrumentView
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
const InstrumentView = (props) => {
const dispatch = useDispatch()
const instrumentId = get(props, "match.params.instrument_id", "")
const instrument = useSelector(state => get(state.instruments, instrumentId));
- Create a ticketCreate a ticket
Function Instruments
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Instruments = () => {
const dispatch = useDispatch()
const actions = (row) => {
- Create a ticketCreate a ticket
Function AdminImportView
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
const AdminImportView = (props) => {
const dispatch = useDispatch()
const importId = get(props, "match.params.importId", "")
const imports = useSelector(state => state.imports);
- Create a ticketCreate a ticket
Consider simplifying this complex logical expression. Open
if (get(variable.topic, 'id') !== 0 && (!isEmpty(variable.topic) || !isEmpty(variable.sources_topic))) {
sourceOptions = Object.values(sourceOptions).filter(opt => {
return (
get(opt.topic, 'id') == get(variable.topic, 'id') ||
get(opt.resolved_topic, 'id') == get(variable.topic, 'id') ||
- Create a ticketCreate a ticket
Method add_variables
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def add_variables
variable_names = params[:variable_names].is_a?(Array) ? params[:variable_names] : [params[:variable_names]]
variables = @object.instrument.variables.where(name: variable_names)
variables.to_a.compact!
- Create a ticketCreate a ticket