Showing 92 of 92 total issues
Function perform
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
perform(keys = []) {
let swapped = false;
let compFuncs = keys.map((key) => this.comparator(key));
let compFunc = (a, b) => {
- 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 validatable
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export function validatable(target) {
return class extends target {
@tracked _evdVisibleErrors = [];
@tracked _evdShowAllErrors = false;
- 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 performsNonLearnerFunction
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
get performsNonLearnerFunction() {
if (this._directedCoursesData.isResolved && this._directedCoursesData.value.length) {
return true;
}
if (this._administeredCoursesData.isResolved && this._administeredCoursesData.value.length) {
- 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 sortIcon
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
get sortIcon() {
if (this.sortedBy) {
if (this.sortedAscending) {
return this.sortType === 'numeric' ? 'arrow-down-1-9' : 'arrow-down-a-z';
} else {
- 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 addDate
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
@action
addDate(which) {
if (which == 'endDate') {
if (this['startDate']) {
this.updateOtherDate('endDate', this['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 sortIcon
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
get sortIcon() {
if (this.sortedBy) {
if (this.sortedAscending) {
return this.sortType === 'numeric' ? 'arrow-down-1-9' : 'arrow-down-a-z';
} else {
- 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 keyboard
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
@action
keyboard(event) {
const keyCode = event.keyCode;
const target = event.target;
- 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 extractQueryParams
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const extractQueryParams = function (request) {
const params = Object.keys(request.queryParams);
const rhett = {
filterParams: [],
queryTerms: [],
- 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 installUUIDPolyfill
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function installUUIDPolyfill() {
const CRYPTO = window.crypto;
if (!CRYPTO.randomUUID) {
// we might be able to optimize this by requesting more bytes than we need at a time
- 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 sortAsc
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function sortAsc(key, a, b) {
if (isEmpty(key)) {
return 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 getRolesInSchool
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
async getRolesInSchool(school, rolesToCheck = []) {
const roles = [];
if (rolesToCheck.includes('SCHOOL_DIRECTOR') && (await this.isDirectingSchool(school))) {
roles.push('SCHOOL_DIRECTOR');
}
- 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 sortDesc
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function sortDesc(key, a, b) {
if (isEmpty(key)) {
return 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 updateDate
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
@action
updateDate(which, value) {
const { hour, minute } = DateTime.fromJSDate(this[which]);
const { year, ordinal } = DateTime.fromJSDate(value);
this[which] = DateTime.fromObject({
- 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 getShowCopy
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
async getShowCopy(session) {
if (this.router.currentRouteName === 'session.copy') {
return false;
}
- 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 exports
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function (environment) {
const ENV = {
modulePrefix: 'frontend',
environment,
rootURL: '/',
- 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
Consider simplifying this complex logical expression. Open
if (
!this._offeringInstructorsData?.isResolved ||
!this._offeringInstructorGroupsInstructors?.isResolved ||
(this.isIndependentLearning && !this._ilmInstructorsData?.isResolved) ||
(this.isIndependentLearning && !this._ilmSessionInstructorGroupsInstructorsData?.isResolved)
Function cloneLearnerGroup
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
export default async function cloneLearnerGroup(store, group, cohort, withLearners, parent = null) {
Function moveFocus
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
@action
moveFocus({ key, target }) {
switch (key) {
case 'ArrowDown':
if (target.nextElementSibling) {
- 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 getBrowserLogo
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
getBrowserLogo(id) {
if (id === 'ios_saf') {
id = 'safari-ios';
}
if (id === 'samsung') {
- 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 getGraphQLFilters
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
async getGraphQLFilters(prepositionalObject, prepositionalObjectTableRowId, school) {
let rhett = [];
if (school) {
rhett.push(`schools: [${school.id}]`);
}
- 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"