Showing 219 of 2,584 total issues
Function AdminInstrumentDatasetForm
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
const AdminInstrumentDatasetForm = (props) => {
const {datasets, instrument} = props;
const [selectedDatasets, setSelectedDatasets] = React.useState([]);
- Create a ticketCreate a ticket
Function AdminInstrumentImportMappings
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
const AdminInstrumentImportMappings = (props) => {
const dispatch = useDispatch()
const type = "Instrument"
const hint = "You can import multiple Q-V and T-Q mapping files. Only TXT files are accepted."
const instrumentId = get(props, "match.params.instrumentId", "")
- Create a ticketCreate a ticket
Function TopicList
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
const TopicList = (props) => {
const {topicId, datasetId, variableId} = props
const dispatch = useDispatch()
- Create a ticketCreate a ticket
Function AdminDatasetImportMappings
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
const AdminDatasetImportMappings = (props) => {
const dispatch = useDispatch()
const type = "Dataset"
const hint = "You can import multiple T-V and DV mapping files. Only TXT files are accepted."
const datasetId = get(props, "match.params.datasetId", "")
- Create a ticketCreate a ticket
Method import
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
def import(options = {})
Map.where(id: @object.maps.pluck(:id)).delete_all
set_import_to_running
@doc.each do |control_construct_scheme, q, dataset, v|
log :input, "#{control_construct_scheme},#{q},#{dataset},#{v}"
- Create a ticketCreate a ticket
Method copy
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
def copy(new_prefix, other_vals = {})
new_i = self.dup
new_i.prefix = new_prefix
other_vals.select { |key, val| new_i[key] = val }
- Create a ticketCreate a ticket
Method import
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
def import(options = {})
set_import_to_running
vars = @object.variables.includes(:questions, :src_variables, :der_variables, :topic)
begin
@doc.each do |variable_dataset, v, source_dataset, s|
- Create a ticketCreate a ticket
Function ObjectFinder
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ObjectFinder = (instrumentId) => {
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 a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
const ObjectFinder = (instrumentId) => {
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, {})
- 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 import
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def import(options = {})
options.symbolize_keys!
if options.has_key? :import_id
@import = Import.find_by_id(options[:import_id])
- 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 QuestionGridListItem
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
const QuestionGridListItem = (props) => {
const {item} = props;
const classes = useStyles();
if(isNil(item) || isNil(item.question)){
- Create a ticketCreate a ticket
Function render
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const email = this.props.email;
const password = this.props.password;
return (
- Create a ticketCreate a ticket
Method safe_params
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
def safe_params
# The params from Angular use :codes in the params array, we
# tranform these into params that comply with the params expected
# by nested attributes using accepts_nested_attributes for the codes
# and their nested categories.
- Create a ticketCreate a ticket
Method import
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
def import(options = {})
variable_ids_to_delete = @object.variables.pluck(:id)
set_import_to_running
vars = @object.variables.includes(:questions, :src_variables, :der_variables, :topic)
@doc.each do |dataset, v, t|
- Create a ticketCreate a ticket
Method update_rds
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def update_rds(rds)
if rds.nil?
self.response_domain_codes =
self.response_domain_datetimes =
self.response_domain_numerics =
- 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 read_question
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def read_question(node)
question_item = @instrument.question_items.new(
label: node['name'],
literal: node.at_xpath('./qt_properties/label')&.content
)
- 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 format_output_hash
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def format_output_hash(variables)
vars = get_variables
questions = get_questions(variables.map{|v|v["questions"]}.flatten.uniq)
topics = get_topics(variables.map{|v|v["sources_topic"]}.flatten.uniq + variables.map{|v|v["topic"]}.flatten.uniq)
- 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 InstrumentCcQuestions
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
const InstrumentCcQuestions = (props) => {
const dispatch = useDispatch()
const instrumentId = get(props, "match.params.instrument_id", "")
- Create a ticketCreate a ticket
Function UsedByQuestions
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const UsedByQuestions = (props) => {
const {item, instrumentId} = props;
const classes = useStyles();
- Create a ticketCreate a ticket
Function ObjectTypeLookup
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ObjectTypeLookup = (objectType, instrumentId) => {
switch(objectType) {
case('ResponseDomainNumeric'):
return {
path: url(routes.instruments.instrument.build.responseDomains.show, { instrument_id: instrumentId, responseDomainType: objectType, responseDomainId: 'new' }),
- Create a ticketCreate a ticket