Showing 211 of 211 total issues
Avoid too many return
statements within this function. Open
return s;
Avoid too many return
statements within this function. Open
return s;
Avoid too many return
statements within this function. Open
return s;
Avoid too many return
statements within this function. Open
return s;
Avoid too many return
statements within this function. Open
return s;
Avoid too many return
statements within this function. Open
return s;
Avoid too many return
statements within this function. Open
return undefined;
Function updateState
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public updateState(): void {
if (this.profile.lastLeveledUp) {
if (this.isSixMonthsOld(this.profile.lastLeveledUp) && this.profile.level !== 6) {
this.state = CHECKSTATE.REVIEW;
} 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 MostPopular
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const MostPopular: React.FC<MostPopularProps> = ({ type, data }) => {
let icon;
let title;
let labels;
const userID = Users.getID(Meteor.user().username);
- 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 ExplorerCard
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const ExplorerCard: React.FC<ExplorerCardProps> = ({ item, type, inProfile }) => {
const match = useRouteMatch();
const itemName = (type === EXPLORER_TYPE.COURSES) ? Courses.getName(item._id) : docToName(item);
const itemShortDescription = docToShortDescription(item);
const slugName = itemToSlugName(item);
- 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 update
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public update(docID: string, { name, description, interestType, retired, picture, keywords }: InterestUpdate) {
this.assertDefined(docID);
const updateData: { name?: string, description?: string, interestTypeID?: string, retired?: boolean, picture?:string } = {};
if (name) {
updateData.name = name;
- 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 run
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
run({ username, fieldName, fieldValue }) {
// console.log(username, fieldName, fieldValue);
if (Meteor.isServer) {
const profile = Users.getProfile(username);
let profileCollection;
- 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 run
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
run(fixtureData) {
// console.log('loadFixtureMethod', fixtureData);
if (!this.userId) {
throw new Meteor.Error('unauthorized', 'You must be logged in to load a fixture.', '');
} else if (!Roles.userIsInRole(this.userId, [ROLE.ADMIN])) {
- 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 run
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
run({ studentID }) {
if (Meteor.isServer) {
if (!this.userId) {
throw new Meteor.Error('unauthorized', 'You must be logged in to calculate Levels.');
} else if (!Roles.userIsInRole(this.userId, [ROLE.ADMIN, ROLE.ADVISOR])) {
- 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 findProfilesWithRole
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public findProfilesWithRole(role, selector, options) {
const theSelector = (typeof selector === 'undefined') ? {} : selector;
if (role === ROLE.STUDENT) { // TODO why isn't this a switch?
theSelector.isAlumni = false;
return StudentProfiles.findNonRetired(theSelector, options);
- 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 AdminManageInternshipsPage
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const AdminManageInternshipsPage: React.FC = () => {
const [deleteWorking, setDeleteWorking] = useState(false);
const [uploadWorking, setUploadWorking] = useState(false);
const [defineWorking, setDefineWorking] = useState(false);
const [defineProgress, setDefineProgress] = useState(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 removeAllEntities
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const removeAllEntities = (): boolean => {
if (Meteor.isTest || Meteor.isAppTest) {
// assertIntegrity(); // this started failing after update to Meteor 1.6.1!
RadGrad.collections.forEach((collection) => {
if (collection.type !== 'AdminProfile') {
- 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 updateState
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public updateState(): void {
// console.log(this.profile.lastVisited);
const lastVisited = this.profile.lastVisited[PAGEIDS.VISIBILITY] || this.profile.lastVisited[PAGEIDS.STUDENT_VISIBILITY];
if (lastVisited) {
if (this.isSixMonthsOld(lastVisited)) {
- 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 constructor
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
constructor(type: string, schema: any) {
this.type = type;
this.collectionName = `${type}Collection`;
this.collection = new Mongo.Collection(`${type}Collection`);
this.schema = schema.extend(new SimpleSchema({
- 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 getID
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public getID(instance) {
let id;
// If we've been passed a document, check to see if it has an _id field and use that if available.
if (_.isObject(instance) && _.has(instance, '_id')) {
// @ts-ignore
- 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"