Showing 211 of 211 total issues
Function update
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public update(docID: string, {
firstName,
lastName,
picture,
website,
- 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 8 (exceeds 5 allowed). Consider refactoring. Open
public update(docID, {
firstName,
lastName,
picture,
website,
- 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 AdvisorAddStudentTab
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const AdvisorAddStudentTab: React.FC<AdvisorAddStudentWidgetProps> = ({ interests, careerGoals }) => {
const [firstName, setFirstName] = useState('');
const [lastName, setLastName] = useState('');
const [username, setUsername] = useState('');
const [isAlumni, setIsAlumni] = 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
Avoid deeply nested control flow statements. Open
if (preAcademicTerm.termNumber >= academicTerm.termNumber) {
const academicTermName2 = AcademicTerms.toString(preAcademicTerm._id, false);
const description = `${academicTermName}: ${course.num}'s prerequisite ${preCourse.num} is ` +
`after or in ${academicTermName2}.`;
const definitionData = { user, functionName, description, feedbackType };
Avoid deeply nested control flow statements. Open
if (instance.ice.e > 0) {
iceInstances.push(instance);
}
Function ExplorerMultipleItemsMenuNonMobileWidget
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const ExplorerMultipleItemsMenuNonMobileWidget: React.FC<CardExplorerMenuNonMobileWidgetProps> = ({ menuAddedList, type }) => {
const match = useRouteMatch();
const adminEmail = RadGradProperties.getAdminEmail();
const isStudent = isUrlRoleStudent(match);
const isFaculty = isUrlRoleFaculty(match) || isUrlRoleAdvisor(match);
- 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 AdvisorAboutMeWidget
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const AdvisorAboutMeWidget: React.FC<AdvisorAboutMeWidgetProps> = ({ profile, favoriteCareerGoals, favoriteInterests }) => {
const [websiteState, setWebsite] = useState(profile.website);
const [pictureState, setPicture] = useState(profile.picture);
const [aboutMeState, setAboutMe] = useState(profile.aboutMe);
const { username } = useParams();
- 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 CommunityUsersWidget
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const CommunityUsersWidget: React.FC<CommunityUsersWidgetProps> = ({ advisors, faculty, loggedInRole, students }) => {
const tabPaneStyle: React.CSSProperties = {
overflowX: 'hidden',
overflowY: 'hidden',
};
- 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 FacultyAboutMeWidget
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const FacultyAboutMeWidget: React.FC<FacultyPageAboutMeWidgetProps> = ({ profile, favoriteCareerGoals, favoriteInterests }) => {
const [websiteState, setWebsite] = useState(profile.website);
const [pictureState, setPicture] = useState(profile.picture);
const [aboutMeState, setAboutMe] = useState(profile.aboutMe);
const { username } = useParams();
- 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
Avoid deeply nested control flow statements. Open
if (instance.ice.e > 0) {
iceInstances.push(instance);
}
Function define
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public define({ academicTerm, opportunity, sponsor, verified = false, student, retired = false }: OpportunityInstanceDefine) {
// Validate academicTerm, opportunity, verified, and studentID
const termID = AcademicTerms.getID(academicTerm);
const academicTermDoc = AcademicTerms.findDoc(termID);
const studentID = Users.getID(student);
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
public update(docID, { academicTerm, rating, comments, moderated, visible, moderatorComments, retired }: ReviewUpdate) {
this.assertDefined(docID);
const updateData: ReviewUpdateData = {};
if (academicTerm) {
updateData.termID = AcademicTerms.getID(academicTerm);
- 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 testCalcLevel
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const testCalcLevel = (studentID: string): number => {
const instances = _.concat(CourseInstances.find({ studentID })
.fetch(),
OpportunityInstances.find({ studentID })
.fetch());
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
publish() {
if (Meteor.isServer) {
const collection = this.collection;
Meteor.publish(this.collectionName, function filterStudentID(userID) { // eslint-disable-line meteor/audit-argument-checks
if (_.isNil(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 run
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
run({ student, opportunity, academicTerm, verified = false }: { student: string; opportunity: string; academicTerm: string; verified?: boolean; }) {
if (Meteor.isServer) {
// Define a string to hold the result of this process.
let resultMessage = '';
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
run() {
if (!this.userId) {
throw new Meteor.Error('unauthorized', 'You must be logged in to get internships.');
} else {
if (Meteor.isServer) {
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
public updateState(): void {
const userID = this.profile.userID;
const careerGoals = ProfileCareerGoals.findNonRetired({ userID });
if (careerGoals.length < 3) {
this.state = CHECKSTATE.IMPROVE;
- 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 AdvisorOtherTab
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const AdvisorOtherTab: React.FC = () => {
const [bulkCourseDataState, setBulkCourseData] = useState('');
const [alumniEmailsState, setAlumniEmails] = useState('');
const [isAlumniWorkingState, setIsAlumniWorking] = useState(false);
const [isEmailWorkingState, setIsEmailWorking] = 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 nextAcademicTerm
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const nextAcademicTerm = (termDoc: AcademicTerm): AcademicTerm => {
const currentTerm = termDoc.term;
const currentYear = termDoc.year;
let term;
let year = currentYear;
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
publish() {
if (Meteor.isServer) {
const collection = this.collection;
Meteor.publish(this.collectionName, function filterStudentID(userID) { // eslint-disable-line meteor/audit-argument-checks
if (_.isNil(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"