Showing 219 of 2,583 total issues
Function CcLoopForm
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const CcLoopForm = (props) => {
const {ccLoop, instrumentId, onChange, path, onDelete, onCreate} = props;
const dispatch = useDispatch();
const classes = useStyles();
- Create a ticketCreate a ticket
Function ResponseDomainTextForm
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const ResponseDomainTextForm = (props) => {
const {responseDomain, instrumentId, instrument} = props;
const codeLists = useSelector(state => get(state.codeLists, instrumentId, {}));
- Create a ticketCreate a ticket
Function ResponseDomainNumericForm
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const ResponseDomainNumericForm = (props) => {
const {responseDomain, instrumentId, instrument} = props;
const codeLists = useSelector(state => get(state.codeLists, instrumentId, {}));
- Create a ticketCreate a ticket
Function NewConstructQuestion
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
const NewConstructQuestion = (props) => {
const { object, onNodeSelect, onDelete, path, onChange } = props;
const classes = useStyles();
- Create a ticketCreate a ticket
Function LoopItem
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
const LoopItem = (props) => {
const {type, id, instrumentId, title} = props
const classes = useStyles();
const [open, setOpen] = React.useState(true);
- Create a ticketCreate a ticket
Function formFields
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
const formFields = (item) => {
return [
{
size: 12,
field: (
- Create a ticketCreate a ticket
File instrument.rb
has 290 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Importers::XML::DDI
class Instrument < DdiImporterBase
def initialize(thing, options = {})
if thing.is_a? String
@doc = open(thing) { |f| Nokogiri::XML(f) }
- Create a ticketCreate a ticket
Function ResponseDomainDatetimeForm
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const ResponseDomainDatetimeForm = (props) => {
const {responseDomain, instrumentId, instrument} = props;
const dispatch = useDispatch();
const classes = useStyles();
- Create a ticketCreate a ticket
Function AdminUserForm
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const AdminUserForm = (props) => {
const {user} = props;
const dispatch = useDispatch();
const classes = useStyles();
- Create a ticketCreate a ticket
Function buildInstrumentBreadcrumbs
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
const buildInstrumentBreadcrumbs = () => {
const paramsFromPath = () => {
const capturingRegex = `/instruments\\/${instrumentId}\\/(?<type>build|map)\/?(?<subtype>question_grids|question_items|response_domains|code_lists|constructs)?\/?`;
const found = location.pathname.match(new RegExp(capturingRegex));
return get(found, 'groups',{})
- Create a ticketCreate a ticket
Function UserForm
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const UserForm = (props) => {
const {user, onChange, path, onDelete} = props;
const dispatch = useDispatch();
const classes = useStyles();
- Create a ticketCreate a ticket
Method import
has a Cognitive Complexity of 21 (exceeds 5 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|
- 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 V3_2
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def V3_2(qgrid_id)
@klass = ::QuestionGrid
super do |qgrid, qg|
- 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 Dashboard.js
has 287 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { useEffect } from 'react';
import { useSelector } from 'react-redux'
import { get } from 'lodash'
import clsx from 'clsx';
import { makeStyles } from '@material-ui/core/styles';
- Create a ticketCreate a ticket
Function QuestionGridListItem
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
const QuestionGridListItem = (props) => {
const { item, instrumentId } = props
const classes = useStyles();
const title = (isEmpty(item.question)) ? item.label : item.question.literal
- Create a ticketCreate a ticket
Function AdminInstrumentForm
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const AdminInstrumentForm = (props) => {
const {instrument, datasets} = props;
const [signedOff, setSignedOff] = React.useState(instrument.signed_off);
- Create a ticketCreate a ticket
Function DatasetView
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
const DatasetView = (props) => {
const { dataset } = props;
const classes = useStyles();
- Create a ticketCreate a ticket
Function ConfirmationModal
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const ConfirmationModal = (props) => {
const { textToConfirm="", key="prefix", objectType="instrument", onConfirm=()=>{} } = props;
const classes = useStyles();
// getModalStyle is not a pure function, we roll the style only on the first render
const [modalStyle] = React.useState(getModalStyle);
- Create a ticketCreate a ticket
Function SequenceItem
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
const SequenceItem = (props) => {
const { instrumentId } = props;
var {title} = props;
const classes = useStyles();
const [open, setOpen] = React.useState(true);
- Create a ticketCreate a ticket
Method build_instrument
has a Cognitive Complexity of 20 (exceeds 5 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
- 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"