Showing 215 of 2,579 total issues
File index.js
has 1925 lines of code (exceeds 250 allowed). Consider refactoring. Open
import axios from "axios";
import { reverse as url } from 'named-urls'
import routes from '../routes'
const api_host = process.env.REACT_APP_API_HOST
- Create a ticketCreate a ticket
Function DatasetView
has 406 lines of code (exceeds 25 allowed). Consider refactoring. Open
const DatasetView = (props) => {
const dispatch = useDispatch()
const datasetId = get(props, "match.params.dataset_id", "")
- Create a ticketCreate a ticket
Method read_sequence_children
has a Cognitive Complexity of 78 (exceeds 5 allowed). Consider refactoring. Open
def read_sequence_children(node, parent, branch = nil)
position_counter = 0
sub_sequence = lambda do |node, search, cc, branch|
ref = node.at_xpath(search)
- 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 InstrumentMap.js
has 657 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { useEffect, useState } from 'react';
import { useDispatch, useSelector } from 'react-redux'
import { Instrument, CcConditions, CcLoops, CcSequences, CcStatements, CcQuestions, QuestionItems, QuestionGrids, Variables, Topics } from '../actions'
import { Dashboard } from '../components/Dashboard'
import { get, isEmpty, isNil, uniq } from "lodash";
- Create a ticketCreate a ticket
Function render
has 280 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
if(this.props.monthData && this.props.yearData && this.props.projects && this.props.clients){
const revenue_data = [];
- Create a ticketCreate a ticket
Function render
has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring. Open
render() {
if(this.props.monthData && this.props.yearData && this.props.projects && this.props.clients){
const revenue_data = [];
- 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 InstrumentView.js
has 524 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { useEffect, useState } from 'react';
import { useDispatch, useSelector } from 'react-redux'
import { Instrument, CcConditions, CcLoops, CcSequences, CcStatements, CcQuestions, QuestionItems, QuestionGrids, Variables, Topics } from '../actions'
import { Dashboard } from '../components/Dashboard'
import { InstrumentHeading } from '../components/InstrumentHeading'
- Create a ticketCreate a ticket
File InstrumentConstructBuild.js
has 494 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { useEffect, useState } from 'react';
import { useDispatch, useSelector } from 'react-redux'
import { Instrument, CcConditions, CcLoops, CcSequences, CcStatements, CcQuestions, QuestionItems, QuestionGrids, ResponseUnits, InstrumentTree } from '../actions'
import { Dashboard } from '../components/Dashboard'
import { MoveConstructSelect } from '../components/MoveConstructSelect'
- Create a ticketCreate a ticket
Function QuestionGridForm
has 192 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const QuestionGridForm = (props) => {
const {questionGrid, instrumentId, instrument} = props;
var codeLists = useSelector(state => get(state.codeLists, instrumentId, {}));
- Create a ticketCreate a ticket
File DatasetView.js
has 485 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { useEffect, useState } from 'react';
import { useDispatch, useSelector } from 'react-redux'
import { Dataset, DatasetVariable, Topics } from '../actions'
import { Dashboard } from '../components/Dashboard'
import { DatasetHeading } from '../components/DatasetHeading'
- Create a ticketCreate a ticket
Function DatasetView
has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring. Open
const DatasetView = (props) => {
const dispatch = useDispatch()
const datasetId = get(props, "match.params.dataset_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 Tree
has 183 lines of code (exceeds 25 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({});
- Create a ticketCreate a ticket
Function DataTable
has 181 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const DataTable = (props) => {
const { actions=()=>{}, fetch=[], stateKey='instruments', searchKey='prefix', headers=[], rowRenderer=()=>{}, parentStateKey, sortKeys=[] } = props;
let { searchKeys = [searchKey], filters = [] } = props;
- Create a ticketCreate a ticket
Function CodeListForm
has 176 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const CodeListForm = (props) => {
const {codeList, instrumentId, instrument} = props;
const categories = useSelector(state => get(state.categories, instrumentId, {}));
- Create a ticketCreate a ticket
Function InstrumentView
has 165 lines of code (exceeds 25 allowed). Consider refactoring. Open
const InstrumentView = (props) => {
const { instrument } = props;
const classes = useStyles();
- Create a ticketCreate a ticket
Function QuestionItemForm
has 162 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const QuestionItemForm = (props) => {
const {questionItem, instrumentId, instrument} = props;
const dispatch = useDispatch();
const classes = useStyles();
- Create a ticketCreate a ticket
File index.js
has 429 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { combineReducers } from "redux";
import { get } from 'lodash'
const serializeSearchesArrayToObject = (array) =>
array.reduce((obj, item) => {
- Create a ticketCreate a ticket
Method read_sequence_children
has 143 lines of code (exceeds 25 allowed). Consider refactoring. Open
def read_sequence_children(node, parent, branch = nil)
position_counter = 0
sub_sequence = lambda do |node, search, cc, branch|
ref = node.at_xpath(search)
- Create a ticketCreate a ticket
Function CcQuestionForm
has 138 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const CcQuestionForm = (props) => {
const {ccQuestion, instrumentId, onChange, path, onDelete, onCreate} = props;
const questions = useSelector(state => state.cc_questions);
const cc_questions = get(questions, instrumentId, {})
- Create a ticketCreate a ticket
File index.js
has 377 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import ReactDOM from 'react-dom';
import { Link } from 'react-router-dom';
import { connect } from 'react-redux';
import dateFns from 'date-fns';
- Create a ticketCreate a ticket