Showing 380 of 1,390 total issues
Avoid too many return
statements within this function. Open
return 5;
Avoid too many return
statements within this function. Open
return 3.5;
Avoid too many return
statements within this function. Open
return 6;
Avoid too many return
statements within this function. Open
return 5;
Avoid too many return
statements within this function. Open
return 3;
Avoid too many return
statements within this function. Open
return 4.5;
Avoid too many return
statements within this function. Open
return 4;
Avoid too many return
statements within this function. Open
return maxScore - 1;
Avoid too many return
statements within this function. Open
return 1;
Avoid too many return
statements within this function. Open
return 1.5;
Function editMedicalCondition
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
static editMedicalCondition({ body, user }, res) {
if (body.hasOwnProperty('id') && typeof body.id === 'number' &&
((body.hasOwnProperty('outcome') && typeof body.outcome === 'string') || !body.hasOwnProperty('outcome')) &&
((body.hasOwnProperty('resolvedYear') && typeof body.resolvedYear === 'number') || !body.hasOwnProperty('resolvedYear'))) {
MedicalHistoryCore.editMedicalHistory(user, body).then((result) => {
- 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 createConcomitantMed
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
static createConcomitantMed({ body, user }, res) {
if (!body.visitId
|| !body.concomitantMedId
|| !body.indication
|| !body.startDate
- 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 handleMeddraUploadByAdmin
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
static async handleMeddraUploadByAdmin({ user, files }, res) {
if (user.adminPriv !== 1) {
res.status(401).json({ error: 'Not authorized.' });
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 _formatEntries
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
static _formatEntries({ dataTableForeignKey, entryIdString }, { body, user }) {
const returned = {};
const numOfUpdates = (body.hasOwnProperty('update')) ? Object.keys(body.update).length : 0;
const numOfAdds = (body.hasOwnProperty('add')) ? Object.keys(body.add).length : 0;
const updates = [];
- 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 editComorbidity
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
static editComorbidity({ body, user }, res) {
if (body.hasOwnProperty('id') && typeof body.id === 'number') {
const entryObj = Object.assign({}, body);
if (typeof body.comorbidity !== 'number') {
- 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 filterNodes
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const filterNodes = (filter, nodes) =>
nodes.reduce((filtered, n) => {
const { nodes: filteredChildren } = n.children ? filterNodes(filter, n.children) : { nodes: [] };
return !(filter(n) || filteredChildren.length) ? filtered : {
nodes: [
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
_handleSubmit(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 _composeSubmitBody
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
_composeSubmitBody() {
if (this.state.lastSubmit && (new Date()).getTime() - this.state.lastSubmit < 500 ? true : false)
return;
const { references, originalValues } = this;
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
render() {
const { match, location } = this.props;
const { pregnancySubStudyConsent } = this.props.data;
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
render() {
const { match, location } = this.props;
const { pregnancySubStudyConsent } = this.props.data;
const pageNumberToElementMap = {
0: <VisitFrontPageIntroduction match={match} location={location} />,
- 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"