Showing 211 of 211 total issues
Function updateCommonFields
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
protected updateCommonFields(
updateData,
{
firstName,
lastName,
- 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 AddCareerGoalToProfileButton
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
const AddCareerGoalToProfileButton: React.FC<AddCareerGoalToProfileButtonProps> = ({ careerGoal, userID, added }) => {
const [open, setOpen] = useState(false);
const careerGoalInterestIDs = careerGoal.interestIDs;
const profileInterests = ProfileInterests.findNonRetired({ userID });
const shareInterests = profileInterests.length > 0 ? profileInterests[0].share : 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 publish
has a Cognitive Complexity of 14 (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(studentID) {
- 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 14 (exceeds 5 allowed). Consider refactoring. Open
public define({ term, year, retired = false }: AcademicTermDefine) {
// Check that term and year are valid.
if (this.terms.indexOf(term) < 0) {
throw new Meteor.Error(`Invalid term: ${term}`);
}
- 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 PageTrackingScoreboardWidget
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
const PageTrackingScoreboardWidget: React.FC<PageTrackingScoreboardWidgetProps> = ({ pageInterestsDailySnapshots }) => {
const match = useRouteMatch();
const urlCategory: IPageInterestsCategoryTypes = getUrlCategory(match);
// See page-tracking-general.ts to see urlCategory vs category
const category = getCategory(urlCategory);
- 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 StudentExplorerEditReviewForm
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
const StudentExplorerEditReviewForm: React.FC<StudentExplorerEditReviewWidgetProps> = ({ review, itemToReview }) => {
const formRef = React.createRef();
const [activeState, setActive] = useState(false);
const [confirmOpenState, setConfirmOpen] = useState(false);
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 RadGradLoginButtons
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
const RadGradLoginButtons: React.FC<RadGradLoginButtonsProps> = ({ instanceName = '', size = 'medium', inverted = false }) => {
const [pathname, setPathname] = useState<string>('');
const [redirectToRefererState, setRedirectToReferer] = useState<boolean>(false);
const handleClick = (e, instance) => {
- 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 SigninPage
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
const SigninPage: React.FC = () => {
const [emailState, setEmail] = useState('');
const [passwordState, setPassword] = useState('');
const [errorState, setError] = useState('');
const [redirectToRefererState, setRedirectToReferer] = 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 publish
has a Cognitive Complexity of 13 (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(studentID) {
- 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 >= 100 &&
earnedICE.c >= 100 &&
earnedICE.e >= 100 &&
numReviews >= 6 &&
plannedICE.i >= 100 &&
Consider simplifying this complex logical expression. Open
} else if (earnedICE.i >= 30 &&
earnedICE.c >= 36 &&
earnedICE.e >= 30 &&
numReviews >= 0 &&
plannedICE.i >= 100 &&
Consider simplifying this complex logical expression. Open
} else if (earnedICE.i >= 80 &&
earnedICE.c >= 80 &&
earnedICE.e >= 80 &&
numReviews >= 1 &&
plannedICE.i >= 100 &&
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 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 publish
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public publish() {
if (Meteor.isServer) {
const collection = this.collection;
Meteor.publish(this.collectionName, function filterStudent(studentID) { // eslint-disable-line meteor/audit-argument-checks
if (_.isNil(studentID)) {
- 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 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 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 processInternAlohaInternships
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export const processInternAlohaInternships = async () => {
// get the internships
const rawInternships = await getAllInternAlohaInternships();
console.log('raw internships', rawInternships.length);
// add 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 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"