Showing 219 of 2,584 total issues
Function render
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
return (
<main>
- Create a ticketCreate a ticket
Function ObjectCheckForInitialValues
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export const ObjectCheckForInitialValues = (initialValues, values) => {
// For every field initially provided, we check whether it value has been removed
// and set it explicitly to an empty string
if (!initialValues) return values;
const initialValuesWithEmptyFields = Object.keys(initialValues).reduce(
- 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 construct_children
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def construct_children(branch = nil)
query_children = lambda do |query_branch, cc|
if query_branch.nil?
return cc.children.map { |c| {id: c.id, type: c.class.name } }
else
- 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 Tree
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const Tree = (props) => {
const { topSequence, instrumentId, dispatch, onNodeSelect } = props
const objectFinder = ObjectFinder(instrumentId);
const [treeData, setTreeData] = useState([TreeNode(instrumentId, 'CcSequence', topSequence.id, objectFinder, true)]);
const [selectedNode, setSelectedNode] = useState({});
- 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 VariableList
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const VariableList = (props) => {
const {variables, instrumentId, ccQuestionId, x, y, topicId, label='Variables'} = props
const dispatch = useDispatch()
- 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 VariableTableRow
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
const VariableTableRow = (props) => {
const { row } = props;
const status = ObjectStatus(row.id, 'DatasetVariable')
- Create a ticketCreate a ticket
Function registerValidSW
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function registerValidSW(swUrl, config) {
navigator.serviceWorker
.register(swUrl)
.then(registration => {
registration.onupdatefound = () => {
- Create a ticketCreate a ticket
Function ReadOnlyVariableTableRow
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ReadOnlyVariableTableRow = (props) => {
const { row } = props;
const status = ObjectStatus(row.id, 'DatasetVariable')
- Create a ticketCreate a ticket
Method XML_node
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def XML_node(node)
codes_to_add = []
node.xpath('./Code').each_with_index do |code, i|
begin
co = ::Code.new ({
- Create a ticketCreate a ticket
Function actions
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
const actions = (row) => {
return (
<ButtonGroup variant="outlined">
<Button>
<Link to={url(routes.admin.datasets.dataset.show, { dataset_id: row.id })}>View</Link>
- Create a ticketCreate a ticket
Function Datasets
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Datasets = () => {
const dispatch = useDispatch()
const actions = (row) => {
- Create a ticketCreate a ticket
Function actions
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
const actions = (row) => {
return (
<>
<ButtonGroup variant="outlined">
<Button>
- Create a ticketCreate a ticket
Function ConditionItem
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ConditionItem = (props) => {
const {type, id, instrumentId, title} = props
const classes = useStyles();
const [open, setOpen] = React.useState(true);
- Create a ticketCreate a ticket
Function render
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
let message = this.props.message
let position = this.props.position
let size = this.props.size
- Create a ticketCreate a ticket
Method clear_cached_stats
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def clear_cached_stats
self.class.reflections.keys.each do |key|
if self.class.reflections[key].is_a? ActiveRecord::Reflection::BelongsToReflection
unless self.send(key).nil?
begin
- 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 shim_construct_type
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def shim_construct_type(p)
# Ensure that if the parent_type is a valid ParentalContstruct class name
# or that it can be matched to one.
parental_classes = %w(CcCondition CcLoop CcQuestion CcSequence CcStatement)
unless p[:parent_type].nil? || parental_classes.include?(p[:parent_type])
- 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 all
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def all
instruments = Rails.cache.fetch('instruments.json&#{auth_token}', version: Instrument.maximum(:updated_at).to_i) do
connection = ActiveRecord::Base.connection
sql = %|
SELECT instruments.id, instruments.agency, instruments.version, instruments.prefix, instruments.label, instruments.slug, instruments.study, instruments.signed_off, COUNT(DISTINCT(control_constructs.id)) as ccs, COUNT(DISTINCT(qv_mappings.id)) as qvs
- 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 update
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def update
with_unconfirmed_confirmable do
if @confirmable.has_no_password?
@confirmable.attempt_set_password(params[:user])
if @confirmable.valid? and @confirmable.password_match?
- 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 HumanizeObjectType
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const HumanizeObjectType = (type) => {
switch (type){
case 'statement':
case 'CcStatement':
return 'Statement'
- Create a ticketCreate a ticket
Function actions
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
const actions = (row) => {
return (
<>
<ButtonGroup variant="outlined">
<Button>
- Create a ticketCreate a ticket