Showing 211 of 211 total issues
Function PictureField
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const PictureField: React.FC<TextFieldProps> = ({
autoComplete,
className,
disabled,
error,
- 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 getCurrentTerm
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public getCurrentTerm() {
const isQuarter = this.isQuarterSystem();
let fallStart;
let springStart;
let summerStart;
- 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 AddVerificationRequestForm
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const AddVerificationRequestForm: React.FC<AddVerificationRequestFormProps> = ({
students,
academicTerms,
opportunities,
opportunityInstances,
- 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 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 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 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 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 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
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
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 &&
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
} 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.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 &&
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 ExplorerOpportunity
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const ExplorerOpportunity: React.FC<ExplorerOpportunitiesProps> = ({ opportunity, opportunityTypes, opportunities, terms, interests, sponsors, completed, itemReviews, profile, review, teaser }) => {
const segmentStyle = { backgroundColor: 'white' };
const compactRowStyle = { paddingTop: 3, paddingBottom: 3 };
const gridStyle = { paddingLeft: 17, paddingTop: 10, paddingBottom: 17 };
const hasTeaser = teaser.length > 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 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"