Showing 219 of 2,583 total issues
Function AdminImports
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const AdminImports = () => {
const dispatch = useDispatch()
const imports = useSelector(state => state.imports);
const [page, setPage] = React.useState(0);
- Create a ticketCreate a ticket
Function LoopItem
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
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 InstrumentForm
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const InstrumentForm = (props) => {
const {instrument, onChange, path, onDelete} = props;
const dispatch = useDispatch();
const classes = useStyles();
- Create a ticketCreate a ticket
Function CcSequenceForm
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const CcSequenceForm = (props) => {
const {ccSequence, instrumentId, onChange, path, onDelete, onCreate} = props;
const dispatch = useDispatch();
const classes = useStyles();
- Create a ticketCreate a ticket
Function AdminInstrumentExports
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const AdminInstrumentExports = () => {
const dispatch = useDispatch()
const [message, setMessage] = useState()
- Create a ticketCreate a ticket
Method V3_2
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def V3_2(qgrid_id)
@klass = ::QuestionGrid
super do |qgrid, qg|
- Create a ticketCreate a ticket
Method V3_2
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def V3_2(con_id)
if con_id.is_a? ::CcCondition
cc = con_id
else
cc = ::CcCondition.find con_id
- Create a ticketCreate a ticket
Function DatasetImportView
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const DatasetImportView = (props) => {
const { datasetImport } = props;
const classes = useStyles();
- Create a ticketCreate a ticket
Function InstrumentImportView
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const InstrumentImportView = (props) => {
const { instrumentImport } = props;
const classes = useStyles();
- Create a ticketCreate a ticket
Function DatasetForm
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const DatasetForm = (props) => {
const {dataset, onChange, path, onDelete} = props;
const dispatch = useDispatch();
const classes = useStyles();
- Create a ticketCreate a ticket
Function InstrumentImportView
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const InstrumentImportView = (props) => {
const { instrumentImport } = props;
const classes = useStyles();
- Create a ticketCreate a ticket
Function App
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const App = () => {
return (
<MuiThemeProvider theme={theme}>
<Router>
- Create a ticketCreate a ticket
File CodeListForm.js
has 272 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React from 'react';
import { get, isNil } from "lodash";
import { Form } from 'react-final-form';
import { useDispatch, useSelector } from 'react-redux'
import { CodeLists } from '../actions'
- Create a ticketCreate a ticket
Function formFields
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const formFields = (item) => {
return [
{
size: 12,
field: (
- Create a ticketCreate a ticket
Method import
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
Open
def import(options = {})
cc_question_ids_to_delete = @object.cc_questions.pluck(:id)
set_import_to_running
@doc.each do |control_construct_scheme, q, t|
log :input, "#{control_construct_scheme},#{q},#{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 read_question
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def read_question(node)
question_item = @instrument.question_items.new(
label: node['name'],
literal: node.at_xpath('./qt_properties/label')&.content
)
- Create a ticketCreate a ticket
Function AdminInstruments
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const AdminInstruments = () => {
const dispatch = useDispatch()
const deleteInstrument = (instrumentId) => {
- Create a ticketCreate a ticket
Class InstrumentsController
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class InstrumentsController < ImportableController
include Importers::Controller
include Exporters
has_importers({
- Create a ticketCreate a ticket
Class FragmentInstance
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class FragmentInstance
attr_accessor :questions, :errors
def initialize(xml_fragment, instrument)
- Create a ticketCreate a ticket
Function Login
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function Login() {
const classes = useStyles();
const emailField = useFormField();
const passwordField = useFormField();
- Create a ticketCreate a ticket