Showing 219 of 2,583 total issues
Method import
has a Cognitive Complexity of 31 (exceeds 5 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}"
- 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 BreadcrumbBar
has 111 lines of code (exceeds 25 allowed). Consider refactoring. Open
const BreadcrumbBar = (props) => {
const {instrumentId} = props
const location = useLocation();
- Create a ticketCreate a ticket
Method safe_params
has a Cognitive Complexity of 30 (exceeds 5 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.
- 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
File QuestionGridForm.js
has 347 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { useEffect } from 'react';
import { get, isNil } from "lodash";
import { Form } from 'react-final-form';
import { useDispatch, useSelector } from 'react-redux'
import { QuestionGrids, ResponseDomainNumerics, ResponseDomainTexts, ResponseDomainDatetimes, ResponseDomainCodes, CodeLists } from '../actions'
- Create a ticketCreate a ticket
Function InstrumentBuild
has 103 lines of code (exceeds 25 allowed). Consider refactoring. Open
const InstrumentBuild = (props) => {
const dispatch = useDispatch()
const classes = useStyles();
- Create a ticketCreate a ticket
Method copy
has a Cognitive Complexity of 28 (exceeds 5 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 }
- 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 BreadcrumbBar
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
const BreadcrumbBar = (props) => {
const {instrumentId} = props
const location = useLocation();
- 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 SourcesList
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
const SourcesList = (props) => {
const { sources, datasetId, variable } = props
let { sourceOptions } = props
- Create a ticketCreate a ticket
Function VariableSourcesList
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
const VariableSourcesList = (props) => {
const { sources, datasetId, variable } = props
let { sourceOptions } = props
- Create a ticketCreate a ticket
Function InstrumentMap
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
const InstrumentMap = (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 VariableList
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
const VariableList = (props) => {
const {variables, instrumentId, ccQuestionId, x, y, topicId, label='Variables'} = props
const dispatch = useDispatch()
- Create a ticketCreate a ticket
Function BuildContainer
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const BuildContainer = (props) => {
let history = useHistory();
const { instrumentId, selectionPath = () => { }, heading = "Code Lists", itemId, itemType, objectType = "CodeList", stateKey = "codeLists", fetch = [], formRenderer = () => { }, defaultValues = { used_by: [], min_responses: 1, max_responses: 1 }} = props;
const { findSelectedItem = (items, itemId, itemType) => { return get(items, itemId, {}) }, listItemLabel = (item) => { return item.label }, listItemValue = (item) => { return item.used_by.length }, headingContent = (instrumentId) => { return '' } } = props;
- Create a ticketCreate a ticket
Method question_grid_node
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def question_grid_node(node)
question = ::QuestionGrid.new(
{
urn: node.at_xpath('./URN').content,
label: node.at_xpath('./QuestionGridName/String').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
Class Instrument
has 27 methods (exceeds 20 allowed). Consider refactoring. Open
class Instrument < ApplicationRecord
# This model is exportable as DDI
include Exportable
# This model can be tracked using an Identifier
- Create a ticketCreate a ticket
Function Dashboard
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const Dashboard = (props) => {
const classes = useStyles();
const [open, setOpen] = React.useState(false);
const dispatch = useDispatch();
const { instrumentId } = props;
- Create a ticketCreate a ticket
Function formFields
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
const formFields = (item, signedOff, setSignedOff) => {
return [
{
size: 12,
field: (
- Create a ticketCreate a ticket
Method import
has a Cognitive Complexity of 22 (exceeds 5 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|
- 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 ConditionItem
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ConditionItem = (props) => {
const { instrumentId } = props;
var {title} = props;
const classes = useStyles();
const [open, setOpen] = React.useState(true);
- Create a ticketCreate a ticket
Function CcConditionForm
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const CcConditionForm = (props) => {
const {ccCondition, instrumentId, onChange, path, onDelete, onCreate} = props;
const dispatch = useDispatch();
const classes = useStyles();
- Create a ticketCreate a ticket
Function CcStatementForm
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const CcStatementForm = (props) => {
const {ccStatement, instrumentId, onChange, path, onDelete, onCreate} = props;
const dispatch = useDispatch();
const classes = useStyles();
- Create a ticketCreate a ticket