Showing 1,390 of 1,390 total issues
Function createTest
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
static createTest({ body, user }, res) {
if (!body.hasOwnProperty('visitId') || !body.hasOwnProperty('expectedOccurDate') || !body.hasOwnProperty('type')) {
res.status(400).json(ErrorHelper(message.userError.MISSINGARGUMENT));
return;
}
Function createConcomitantMed
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
static createConcomitantMed({ body, user }, res) {
if (!body.visitId
|| !body.concomitantMedId
|| !body.indication
|| !body.startDate
Function render
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const el = this.props.data;
if (this.state.editing) {
return (
Function _formatBody
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
_formatBody(update, add) {
const { params } = this.props.match;
const { outcomeApplicable, pregnancyEntry } = this.state;
const entryType = pregnancyEntry.type === 1 ? 1 : (outcomeApplicable === 'yes' ? 3 : 2);
Function render
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { fetching, data, match, location } = this.props;
if (fetching) {
return null;
}
Function _handleClick
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
_handleClick(ev) {
ev.target.nextSibling.checked = true;
const value = ev.target.nextSibling.value;
const radioGroup = ev.target.parentElement.parentElement.children;
for (let i = 0; i < radioGroup.length; i++) {
Function _RouterAddOrUpdate
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
static _RouterAddOrUpdate(req, res) {
if (optionsContainer.hasOwnProperty(`${req.params.dataType}`)) {
const options = optionsContainer[req.params.dataType];
if (!(req.body.hasOwnProperty(`${options.entryIdString}`) &&
(req.body.hasOwnProperty('add') || req.body.hasOwnProperty('update')))) {
- Read upRead up
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 updateCe
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
static updateCe({ body, user }, res) {
if (!body.hasOwnProperty('id')) {
res.status(400).json(ErrorHelper(message.userError.MISSINGARGUMENT));
return;
}
- Read upRead up
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 editDemographic
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
static editDemographic({ body, user }, res) {
if (body.hasOwnProperty('id') && typeof body.id === 'number') {
if (body.DOB) {
const momentDOB = moment(body.DOB, moment.ISO_8601);
if (!momentDOB.isValid()) {
- Read upRead up
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 editImmunisation
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
static editImmunisation({ body, user }, res) {
if (body.hasOwnProperty('id') && typeof body.id === 'number' &&
((body.hasOwnProperty('immunisationDate') && typeof body.immunisationDate === 'string') || !body.hasOwnProperty('immunisationDate'))) {
const momentImmun = moment(body.immunisationDate, moment.ISO_8601);
if (body.hasOwnProperty('immunisationDate') && body.immunisationDate !== null && !momentImmun.isValid()) {
- Read upRead up
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 createPatientDiagnosis
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
static createPatientDiagnosis({ body, user }, res) {
const entryObj = {};
if (body.hasOwnProperty('patient') && body.hasOwnProperty('diagnosis') && body.hasOwnProperty('diagnosisDate') &&
typeof body.patient === 'number' && typeof body.diagnosis === 'number' && typeof body.diagnosisDate === 'string') {
const momentDiagnos = moment(body.diagnosisDate, moment.ISO_8601);
- Read upRead up
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 render
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
render() {
const { patientProfile, match } = this.props;
const { params } = match;
let _style = scaffold_style;
- Read upRead up
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 _handleSubmitClick
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
_handleSubmitClick(ev) {
ev.preventDefault();
if (this.state.lastSubmit && (new Date()).getTime() - this.state.lastSubmit < 500 ? true : false)
return;
- Read upRead up
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 OffspringDataFields
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
const OffspringDataFields = ({
originalValues,
atDeliveryOutcome,
onOffspringChange
}) => {
- Read upRead up
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 render
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
render() {
if (!this.state.dispatched) {
const { genders, dominant_hands, ethnicities, countries } = this.props.demofields;
let genders_sorted = [];
genders.forEach((el) => {
- Read upRead up
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 _handleClick
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
_handleClick(ev) {
ev.target.nextSibling.checked = true;
const value = ev.target.nextSibling.value;
const radioGroup = ev.target.parentElement.parentElement.children;
for (let i = 0; i < radioGroup.length; i++) {
- Read upRead up
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 render
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
render() {
const { editing, startDate, endDate, noEndDate, reason, meddra, startDate_original, endDate_original, reason_original, meddra_original } = this.state;
const { data, interruptionReasons, meddra_Hash } = this.props;
return (
<div className={style.interruption} style={{
- Read upRead up
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 _handleSubmit
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
_handleSubmit(ev) {
ev.preventDefault();
if (this.state.lastSubmit && (new Date()).getTime() - this.state.lastSubmit < 500 ? true : false)
return;
const { patientId } = this.props;
- Read upRead up
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 render
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
render() {
const { editing, startDate, outcomeDate, noEndDate, outcome, meddra, startDate_original, outcomeDate_original, outcome_original, meddra_original } = this.state;
const { data, pregnancyOutcomes, meddra_Hash } = this.props;
return (
<div className={style.interruption} style={{
- Read upRead up
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 exportDatabase
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
static exportDatabase({ query }, res) {
const isPatientMappings = query.patientMappings !== undefined;
const isCDISC = query.cdisc !== undefined;
let queryfield = '';