Showing 380 of 1,390 total issues
Function _handleSubmit
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
_handleSubmit(ev) {
ev.preventDefault();
if (this.state.lastSubmit && (new Date()).getTime() - this.state.lastSubmit < 500 ? true : false)
return;
SelectorUtils
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
class SelectorUtils {
getConcomitantMeds(patientId, deleted) {
const whereObj = { patient: patientId };
if (deleted !== true)
PregnancyEntry
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
@withRouter
@connect(mapStateToProps)
class PregnancyEntry extends Component {
constructor(props) {
super();
Function _composeSubmitBody
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
_composeSubmitBody() {
if (this.state.lastSubmit && (new Date()).getTime() - this.state.lastSubmit < 500 ? true : false)
return;
const { references, originalValues } = this;
Function render
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {
groups,
items,
defaultTimeStart,
Function migrate
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
export async function migrate() {
// Verify the OPT_KV configuration table exists
const isIntitialized = await dbcon().schema.hasTable('OPT_KV');
let stepVersion = 0;
- 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 createApi
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
.then((optimise_router) => {
console.log('optimise_router', optimise_router);
// Remove unwanted express headers
File editMedication.jsx
has 259 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { Component } from 'react';
import { connect } from 'react-redux';
import moment from 'moment';
import { NavLink } from 'react-router-dom';
import { BackButton } from '../medicalData/utils';
Function render
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { match, location } = this.props;
const { pregnancySubStudyConsent } = this.props.data;
Function apiHelper
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const apiHelper = (endpoint, options, blockError) => {
if (!options) {
options = {};
}
Function render
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { patientProfile, match } = this.props;
const { params } = match;
let _style = scaffold_style;
File createPatient.jsx
has 256 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { Redirect } from 'react-router-dom';
import moment from 'moment';
import { PickDate } from '../createMedicalElements/datepicker';
Function constructor
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(props) {
super(props);
const state = {
currentTermName: '',
filterText: '',
Function getICD11Field
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
static async getICD11Field({ query }, res) {
const result = [];
const maxOccurency = 20;
await ICD11Controller.loadICD11Collection();
if (query.hasOwnProperty('search')) {
- 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 16 (exceeds 5 allowed). Consider refactoring. Open
render() {
const { patientProfile, fields } = this.props;
const { pregnancyOutcomes, meddra_Hash } = fields;
if (!patientProfile.fetching) {
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 _handleSubmit
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
_handleSubmit(ev) {
ev.preventDefault();
if (this.state.lastSubmit && (new Date()).getTime() - this.state.lastSubmit < 500 ? true : false)
return;
if (!this.state.newStartDate || !this.state.newStartDate.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 start
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
start() {
const _this = this;
return new Promise((resolve, reject) => {
// Operate database migration if necessary
Function start
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
start() {
const _this = this;
return new Promise((resolve, reject) => {
// Operate database migration if necessary
Function render
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { patientProfile, match } = this.props;
const { params } = match;
let _style = scaffold_style;
Function _handleSubmit
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
_handleSubmit(ev) {
ev.preventDefault();
if (this.state.lastSubmit && (new Date()).getTime() - this.state.lastSubmit < 500 ? true : false)
return;
const { references, originalValues } = this;