Showing 92 of 92 total issues
File user.js
has 521 lines of code (exceeds 250 allowed). Consider refactoring. Open
import Model, { hasMany, belongsTo, attr } from '@ember-data/model';
import { TrackedAsyncData } from 'ember-async-data';
import { cached } from '@glimmer/tracking';
import { mapBy, uniqueValues } from 'ilios-common/utils/array-helpers';
File offering-form.js
has 508 lines of code (exceeds 250 allowed). Consider refactoring. Open
import Component from '@glimmer/component';
import { tracked } from '@glimmer/tracking';
import { action } from '@ember/object';
import { service } from '@ember/service';
import { isEmpty, isPresent } from '@ember/utils';
File session.js
has 504 lines of code (exceeds 250 allowed). Consider refactoring. Open
import Model, { hasMany, belongsTo, attr } from '@ember-data/model';
import { DateTime } from 'luxon';
import sortableByPosition from 'ilios-common/utils/sortable-by-position';
import striptags from 'striptags';
import { filter } from 'rsvp';
File sequence-block-overview.js
has 428 lines of code (exceeds 250 allowed). Consider refactoring. Open
import Component from '@glimmer/component';
import { tracked } from '@glimmer/tracking';
import { action } from '@ember/object';
import { service } from '@ember/service';
import { isPresent } from '@ember/utils';
File user-profile-permissions.js
has 379 lines of code (exceeds 250 allowed). Consider refactoring. Open
import Component from '@glimmer/component';
import { cached, tracked } from '@glimmer/tracking';
import { action } from '@ember/object';
import { service } from '@ember/service';
import { DateTime } from 'luxon';
File permission-checker.js
has 374 lines of code (exceeds 250 allowed). Consider refactoring. Open
import Service, { service } from '@ember/service';
export default class PermissionCheckerService extends Service {
@service currentUser;
@service permissionMatrix;
File current-user.js
has 372 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { isEmpty } from '@ember/utils';
import { get } from '@ember/object';
import Service, { service } from '@ember/service';
import { DateTime } from 'luxon';
import jwtDecode from 'ilios-common/utils/jwt-decode';
File learner-group.js
has 367 lines of code (exceeds 250 allowed). Consider refactoring. Open
import Model, { hasMany, belongsTo, attr } from '@ember-data/model';
import escapeRegExp from 'ilios-common/utils/escape-reg-exp';
import { map } from 'rsvp';
import { TrackedAsyncData } from 'ember-async-data';
import { cached } from '@glimmer/tracking';
Function parseFile
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
async parseFile(proposedUsers) {
const cohort = await this.args.learnerGroup.cohort;
const data = await map(
proposedUsers,
async ({ firstName, lastName, campusId, subGroupName }) => {
- 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 _asArray
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
function _asArray(maybeArray) {
if (typeof maybeArray === 'number') {
throw new Error('Numbers not supported as arrays [ilios-common]');
}
if (typeof maybeArray === 'string') {
- 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
File bulk-new-users.js
has 343 lines of code (exceeds 250 allowed). Consider refactoring. Open
import Component from '@glimmer/component';
import { cached, tracked } from '@glimmer/tracking';
import { getOwner } from '@ember/application';
import { action } from '@ember/object';
import CoreObject from '@ember/object/core';
File new-subject.js
has 340 lines of code (exceeds 250 allowed). Consider refactoring. Open
import Component from '@glimmer/component';
import { service } from '@ember/service';
import { dropTask } from 'ember-concurrency';
import { validatable, Length, Custom } from 'ilios-common/decorators/validation';
import { TrackedAsyncData } from 'ember-async-data';
Function calendarEventTooltip
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
export default function calendarEventTooltip(event, intl, timeFormat) {
const addLocationToContents = function (contents, eventLocation) {
if (!isBlank(eventLocation)) {
contents = contents + `${eventLocation}<br />`;
}
- 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
File root.js
has 314 lines of code (exceeds 250 allowed). Consider refactoring. Open
import Component from '@glimmer/component';
import { cached, tracked } from '@glimmer/tracking';
import { action } from '@ember/object';
import ObjectProxy from '@ember/object/proxy';
import { service } from '@ember/service';
File session-overview.js
has 276 lines of code (exceeds 250 allowed). Consider refactoring. Open
import Component from '@glimmer/component';
import { cached, tracked } from '@glimmer/tracking';
import { action } from '@ember/object';
import { service } from '@ember/service';
import { isEmpty } from '@ember/utils';
File new-sequence-block.js
has 269 lines of code (exceeds 250 allowed). Consider refactoring. Open
import Component from '@glimmer/component';
import { tracked } from '@glimmer/tracking';
import { action } from '@ember/object';
import { service } from '@ember/service';
import { dropTask, restartableTask } from 'ember-concurrency';
File course.js
has 261 lines of code (exceeds 250 allowed). Consider refactoring. Open
import Model, { hasMany, belongsTo, attr } from '@ember-data/model';
import sortableByPosition from 'ilios-common/utils/sortable-by-position';
import { TrackedAsyncData } from 'ember-async-data';
import { cached } from '@glimmer/tracking';
import { map } from 'rsvp';
File new-directory-user.js
has 258 lines of code (exceeds 250 allowed). Consider refactoring. Open
import Component from '@glimmer/component';
import { cached, tracked } from '@glimmer/tracking';
import { action } from '@ember/object';
import { service } from '@ember/service';
import { isEmpty, isPresent } from '@ember/utils';
Function getDescriptiveProperties
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
async getDescriptiveProperties(
subject,
prepositionalObject,
prepositionalObjectTableRowId,
school,
- 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 transformNode
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
transformNode(node) {
if (node.path.type === 'PathExpression' && node.path.original === 'has-error-for') {
if (!node.params[0] || node.params[0].type !== 'PathExpression') {
throw new Error(
'the (has-error-for) helper requires a path to be passed in as its first parameter, received: ' +
- 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"