Showing 211 of 211 total issues
Function UpdateUserForm
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const UpdateUserForm: React.FC<UpdateUserProps> = ({
id,
interests,
careerGoals,
academicTerms,
- 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 LandingOpportunityExplorerPage
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const LandingOpportunityExplorerPage: React.FC<OpportunityExplorerProps> = ({ opportunity, relatedCourses, relatedCareerGoals }) => {
const match = useRouteMatch();
const teaser = Teasers.findNonRetired({ targetSlugID: opportunity.slugID });
const hasTeaser = teaser.length > 0;
const opportunityType = OpportunityTypes.findDoc(opportunity.opportunityTypeID).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 define
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public define({ academicTerm, course, verified = false, fromRegistrar = false, grade = '', note = '', student, creditHrs, retired = false }: CourseInstanceDefine) {
// Check arguments
const termID = AcademicTerms.getID(academicTerm);
const academicTermDoc = AcademicTerms.findDoc(termID);
const courseID = Courses.getID(course);
- 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 publish
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public publish() {
if (Meteor.isServer) {
const collection = this.collection;
// eslint-disable-next-line meteor/audit-argument-checks
Meteor.publish(this.collectionName, function publish(userID) {
- 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 checkForNoItems
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export const checkForNoItems = (match: MatchProps, type: IExplorerTypes): Element | JSX.Element | string => {
switch (type) {
case EXPLORER_TYPE.CAREERGOALS:
return (
<React.Fragment>
- 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 loadDatabase
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export const loadDatabase = () => {
const loadFileName = Meteor.settings.databaseRestoreFileName;
if (loadFileName && (totalDocuments() === 0 || totalDocuments() === 1)) {
const loadFileAge = getRestoreFileAge(loadFileName);
console.log(`Loading database from file ${loadFileName}, dumped ${loadFileAge}.`);
- 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 ProfileCard
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const ProfileCard: React.FC<ProfileCardProps> = ({ name, email, image, website, level, ice, careerGoals, interests, courses, opportunities, fluid = false }) => {
const levelIconURL = `/images/level-icons/radgrad-level-${level}-icon.png`;
const userID = Users.getID(email);
const tabPanes = [];
if (interests) {
- 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 10 (exceeds 5 allowed). Consider refactoring. Open
public update(instance: string, { name, shortName, num, description, creditHrs, interests, picture, syllabus, retired, repeatable }: CourseUpdate) {
const docID = this.getID(instance);
const updateData: {
name?: string;
description?: 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
Function ExplorerMenuNonMobile
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const ExplorerMenuNonMobile: React.FC<ExplorerMenuNonMobileWidgetProps> = ({ menuAddedList, type }) => {
// console.log('ExplorerMenuNonMobile', props);
const marginTopStyle = { marginTop: '5px' };
const match = useRouteMatch();
- 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 AdvisorStudentSelectorWidget
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const AdvisorStudentSelectorWidget: React.FC<AdvisorStudentSelectorWidgetProps> = ({ dispatch, advisorUsername, careerGoals, interests, students, username, alumni, firstName, lastName }) => {
const [fileDataState, setFileData] = useState('');
const [isEmailWorkingState, setIsEmailWorking] = useState(false);
const [isUploadWorkingState, setIsUploadWorking] = useState(false);
const [generatedDataState, setGeneratedData] = useState('');
- 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
} else if (earnedICE.i >= Meteor.settings.public.level.four.earnedICE.i &&
earnedICE.c >= Meteor.settings.public.level.four.earnedICE.c &&
earnedICE.e >= Meteor.settings.public.level.four.earnedICE.e &&
numReviews >= Meteor.settings.public.level.four.reviews &&
plannedICE.i >= Meteor.settings.public.level.four.plannedICE.i &&
Consider simplifying this complex logical expression. Open
} else if (earnedICE.i >= Meteor.settings.public.level.five.earnedICE.i &&
earnedICE.c >= Meteor.settings.public.level.five.earnedICE.c &&
earnedICE.e >= Meteor.settings.public.level.five.earnedICE.e &&
numReviews >= Meteor.settings.public.level.five.reviews &&
plannedICE.i >= Meteor.settings.public.level.five.plannedICE.i &&
Consider simplifying this complex logical expression. Open
} else if (earnedICE.i >= Meteor.settings.public.level.two.earnedICE.i &&
earnedICE.c >= Meteor.settings.public.level.two.earnedICE.c &&
earnedICE.e >= Meteor.settings.public.level.two.earnedICE.e &&
numReviews >= Meteor.settings.public.level.two.reviews &&
plannedICE.i >= Meteor.settings.public.level.two.plannedICE.i &&
Consider simplifying this complex logical expression. Open
} else if (earnedICE.i >= Meteor.settings.public.level.three.earnedICE.i &&
earnedICE.c >= Meteor.settings.public.level.three.earnedICE.c &&
earnedICE.e >= Meteor.settings.public.level.three.earnedICE.e &&
numReviews >= Meteor.settings.public.level.three.reviews &&
plannedICE.i >= Meteor.settings.public.level.three.plannedICE.i &&
Consider simplifying this complex logical expression. Open
if (earnedICE.i >= Meteor.settings.public.level.six.earnedICE.i &&
earnedICE.c >= Meteor.settings.public.level.six.earnedICE.c &&
earnedICE.e >= Meteor.settings.public.level.six.earnedICE.e &&
numReviews >= Meteor.settings.public.level.six.reviews &&
plannedICE.i >= Meteor.settings.public.level.six.plannedICE.i &&
Function define
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public define({
username,
firstName,
lastName,
picture = defaultProfilePicture,
- 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 getCurrentTermID
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public getCurrentTermID() {
const year = moment().year();
const day = moment().dayOfYear();
let term = '';
if (RadGradProperties.getQuarterSystem()) {
- 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 StudentExplorerReviewWidget
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const StudentExplorerReviewWidget: React.FC<StudentExplorerReviewWidgetProps> = ({ itemReviews, userReview, completed, reviewType, itemToReview }) => {
const match = useRouteMatch();
const commentsStyle = { paddingTop: '5px' };
const { rating, comments, username } = reviewData(userReview);
- 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 processRadGradCollection
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const processRadGradCollection = (collection: ICollection) => {
const result: any = {};
// console.log(collection.name/* , collection.contents */);
if (collection.name === 'SemesterCollection') {
result.name = 'AcademicTermCollection';
- 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 define
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public define({
username,
firstName,
lastName,
picture = defaultProfilePicture,
- 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"