Showing 211 of 211 total issues
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 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 VisibilitySettingList
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const VisibilitySettingList: React.FC<StudentVisibilitySettingListProps> = ({ profile, size }) => {
const share = [];
const hide = [];
profile.shareCareerGoals ? share.push('Career Goals') : hide.push('Career Goals');
profile.shareInterests ? share.push('Interests') : hide.push('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 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 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 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 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.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.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
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.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 &&
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 FutureParticipation
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const FutureParticipation: React.FC<FutureParticipationProps> = ({ item }) => {
const isCourse = Courses.isDefined(item._id);
const type = isCourse ? ENROLLMENT_TYPE.COURSE : ENROLLMENT_TYPE.OPPORTUNITY;
const [data, setData] = useState<EnrollmentForecast>({});
const [fetched, setFetched] = useState(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 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 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"