Showing 219 of 2,583 total issues
Function SequenceItem
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
const SequenceItem = (props) => {
const {type, id, instrumentId} = props
var {title} = props;
const classes = useStyles();
const [open, setOpen] = React.useState(true);
- Create a ticketCreate a ticket
Function ResetPassword
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function ResetPassword(props) {
const classes = useStyles();
const reset_password_token = get(props, "match.params.reset_password_token", "")
const passwordField = useFormField();
- Create a ticketCreate a ticket
Function AdminDatasetForm
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const AdminDatasetForm = (props) => {
const {} = props;
const dispatch = useDispatch();
const classes = useStyles();
- Create a ticketCreate a ticket
Function AdminImportInstrumentForm
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const AdminImportInstrumentForm = (props) => {
const {} = props;
const dispatch = useDispatch();
const classes = useStyles();
- Create a ticketCreate a ticket
Class Instrument
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class Instrument < DdiExporterBase
# Creates the XML document for exporting to as
# a DDIInstance
def initialize
@doc = Nokogiri::XML '<ddi:DDIInstance></ddi:DDIInstance>'
- Create a ticketCreate a ticket
Function ForgottenPassword
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function ForgottenPassword() {
const classes = useStyles();
const emailField = useFormField();
- Create a ticketCreate a ticket
File instrument.rb
has 256 lines of code (exceeds 250 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 AdminDatasets
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
const AdminDatasets = () => {
const dispatch = useDispatch()
const deleteDataset = (datasetId) => {
- Create a ticketCreate a ticket
Method update_cols
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def update_cols(cols)
if cols.to_a.empty?
self.rds_qs.delete_all
else
cols.sort_by! { |x| x[:order] }
- 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 add_variables
has a Cognitive Complexity of 16 (exceeds 5 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!
- 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 QuestionItemForm.js
has 252 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 { QuestionItems, ResponseDomainNumerics, ResponseDomainTexts, ResponseDomainDatetimes, ResponseDomainCodes } from '../actions'
- Create a ticketCreate a ticket
Function InstrumentConstructBuild
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
const InstrumentConstructBuild = (props) => {
const classes = useStyles();
const dispatch = useDispatch()
- Create a ticketCreate a ticket
Function formFields
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
const formFields = (item) => {
return [
{
size: 12,
field: (
- Create a ticketCreate a ticket
Method question_grid_node
has 51 lines of code (exceeds 25 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,
- Create a ticketCreate a ticket
Consider simplifying this complex logical expression. Open
if(this.props.monthData && this.props.yearData && this.props.projects && this.props.clients){
const revenue_data = [];
let revenue_forecast = 0;
- 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 = sourceOptions.filter(opt => {
return (
get(opt.topic, 'id') == get(variable.topic, 'id') ||
get(opt, 'topic') == get(variable.topic, 'name') ||
- Create a ticketCreate a ticket
Function QuestionItemListItem
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
const QuestionItemListItem = (props) => {
const {item, instrumentId} = props
const classes = useStyles();
const title = (isEmpty(item.question)) ? item.label : item.question.literal
- Create a ticketCreate a ticket
Function ConditionChildren
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ConditionChildren = (props) => {
const {children, instrumentId, title} = props
const classes = useStyles();
const [open, setOpen] = React.useState(true);
- Create a ticketCreate a ticket
Function TopicList
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
const TopicList = (props) => {
const dispatch = useDispatch()
const {topicId, instrumentId, ccQuestionId=undefined} = props
const { handleChange=(event, value, reason) => {
dispatch(CcQuestions.topic.set(instrumentId, ccQuestionId, (reason === 'clear') ? null : value.id));
- Create a ticketCreate a ticket
Method process
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def process
ActiveRecord::Base.transaction do
parsed_fragment = parse
raise ActiveRecord::Rollback unless valid?
create_categories(parsed_fragment[: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"