Showing 211 of 211 total issues
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 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 updateState
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public updateState(): void {
const interests = Users.getInterestIDs(this.profile.userID);
if (interests.length < 3) {
this.state = CHECKSTATE.IMPROVE;
} else if (this.profile.lastVisited[PAGEIDS.INTEREST_BROWSER]) {
- 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 descriptionPairs
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const descriptionPairs = (item: Opportunity): DescriptionPair[] => {
const retVal = [
{ label: 'Description', value: item.description },
{ label: 'Opportunity Type', value: OpportunityTypes.findDoc(item.opportunityTypeID).name },
{ label: 'Sponsor', value: Users.getProfile(item.sponsorID).username },
- 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 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 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 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"
Further reading
Function run
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
run({ itemID, explorerType }) {
if (!this.userId) {
throw new Meteor.Error('unauthorized', 'You must be logged in to get visible usernames.');
}
const usernames = {};
- 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 findDoc
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public findDoc(name: string | { [key: string]: unknown } | { name } | { _id: string; } | { username: string; }) {
if (_.isNull(name) || _.isUndefined(name)) {
throw new Meteor.Error(`${name} is not a defined ${this.type}`);
}
const doc = (
- 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
public publish() {
if (Meteor.isServer) {
// Meteor.publish(this.collectionName, () => this.collection.find({}, { limit: 0 }));
const collection = this.collection;
// eslint-disable-next-line meteor/audit-argument-checks
- 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 FutureCourseEnrollmentWidget
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const FutureCourseEnrollmentWidget = (props: IFutureCourseEnrollmentWidgetProps) => {
const initData: any = {};
const [dataState, setData] = useState(initData);
getFutureEnrollmentMethod.call(props.courseID, (error, result) => {
if (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 StudentOfInterestWidget
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const StudentOfInterestWidget = (props: IStudentOfInterestWidgetProps) => {
/*
Had to declare the styles as React.CSSProperties to fix the "Type X is not assignable to Type Y" errors
See https://github.com/microsoft/TypeScript/issues/11465#issuecomment-252453037
*/
- 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 ExplorerMenuMobile
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const ExplorerMenuMobile: React.FC<ExplorerMenuMobileWidgetProps> = ({ menuAddedList, type }) => {
const match = useRouteMatch();
const isStudent = Router.isUrlRoleStudent(match);
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
Avoid too many return
statements within this function. Open
return ' <em><a href="https://radgrad.ics.hawaii.edu">' +
' Add more Interests to your profile so we can provide opportunity recommendations!</a></em>';
Avoid too many return
statements within this function. Open
return 1;
Avoid too many return
statements within this function. Open
return html;
Avoid too many return
statements within this function. Open
return s;
Avoid too many return
statements within this function. Open
return 0;