radgrad/radgrad2

View on GitHub

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,
Severity: Minor
Found in app/imports/api/user/FacultyProfileCollection.ts - About 45 mins to fix

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,
Severity: Minor
Found in app/imports/api/user/AdvisorProfileCollection.ts - About 45 mins to fix

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);
Severity: Minor
Found in app/imports/ui/components/advisor/manage/AdvisorAddStudentTab.tsx - About 45 mins to fix

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 };
Severity: Major
Found in archive/api/feedback/FeedbackFunctions.ts - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

            if (instance.ice.e > 0) {
              iceInstances.push(instance);
            }
    Severity: Major
    Found in archive/ui/component/student/ice/StudentIceColumnUnverified.tsx - About 45 mins to fix

      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);
      Severity: Minor
      Found in archive/issue-414/ExplorerMultipleItemsMenuNonMobileWidget.tsx - About 45 mins to fix

      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();
      Severity: Minor
      Found in archive/about-me/AdvisorAboutMeWidget.tsx - About 45 mins to fix

      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',
        };
      Severity: Minor
      Found in archive/issue-367/community-users/CommunityUsersWidget.tsx - About 45 mins to fix

      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();
      Severity: Minor
      Found in archive/old-menus/FacultyAboutMeWidget.tsx - About 45 mins to fix

      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);
              }
      Severity: Major
      Found in archive/ui/component/student/ice/StudentIceColumnVerified.tsx - About 45 mins to fix

        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);
        Severity: Minor
        Found in app/imports/api/opportunity/OpportunityInstanceCollection.ts - About 35 mins to fix

        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);
        Severity: Minor
        Found in app/imports/api/review/ReviewCollection.ts - About 35 mins to fix

        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());
        Severity: Minor
        Found in app/imports/api/level/LevelProcessor.ts - About 35 mins to fix

        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)) {
        Severity: Minor
        Found in app/imports/api/user/profile-entries/ProfileOpportunityCollection.ts - About 35 mins to fix

        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 = '';
        
        
        Severity: Minor
        Found in app/imports/api/verification/VerificationRequestCollection.methods.ts - About 35 mins to fix

        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) {
        Severity: Minor
        Found in app/imports/api/internship/InternshipCollection.methods.ts - About 35 mins to fix

        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;
        Severity: Minor
        Found in app/imports/ui/components/checklist/CareerGoalsChecklist.tsx - About 35 mins to fix

        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);
        Severity: Minor
        Found in app/imports/ui/components/advisor/manage/AdvisorOtherTab.tsx - About 35 mins to fix

        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;
        Severity: Minor
        Found in app/imports/api/academic-term/AcademicTermUtilities.ts - About 35 mins to fix

        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)) {
        Severity: Minor
        Found in app/imports/api/user/profile-entries/ProfileCareerGoalCollection.ts - About 35 mins to fix

        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

        Severity
        Category
        Status
        Source
        Language