radgrad/radgrad2

View on GitHub

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,

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;
Severity: Minor
Found in app/imports/ui/pages/landing/LandingOpportunityExplorerPage.tsx - About 1 hr 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 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');
Severity: Minor
Found in app/imports/ui/components/shared/VisibilitySettingList.tsx - About 1 hr 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 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) {
Severity: Minor
Found in archive/api/feedback/FeedbackInstanceCollection.ts - About 1 hr 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 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>
Severity: Minor
Found in archive/issue-414/utilities/explorer.tsx - About 1 hr 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 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;
Severity: Minor
Found in app/imports/api/course/CourseCollection.ts - About 1 hr 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 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) {
Severity: Minor
Found in app/imports/ui/components/shared/profile/ProfileCard.tsx - About 1 hr 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 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}.`);
Severity: Minor
Found in app/imports/startup/server/initialize-db.ts - About 1 hr 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 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();

Severity: Minor
Found in archive/issue-412/ExplorerMenuNonMobile.tsx - About 1 hr 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 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('');
Severity: Minor
Found in archive/ui/component/advisor/AdvisorStudentSelectorWidget.tsx - About 1 hr 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

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 &&
Severity: Major
Found in app/imports/api/level/LevelProcessor.ts - About 1 hr to fix

    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 &&
    Severity: Major
    Found in app/imports/api/level/LevelProcessor.ts - About 1 hr to fix

      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 &&
      Severity: Major
      Found in app/imports/api/level/LevelProcessor.ts - About 1 hr to fix

        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 &&
        Severity: Major
        Found in app/imports/api/level/LevelProcessor.ts - About 1 hr to fix

          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 &&
          Severity: Major
          Found in app/imports/api/level/LevelProcessor.ts - About 1 hr to fix

            Function define has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

              public define({
                username,
                firstName,
                lastName,
                picture = defaultProfilePicture,
            Severity: Minor
            Found in app/imports/api/user/FacultyProfileCollection.ts - About 55 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 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);
            Severity: Minor
            Found in app/imports/ui/components/shared/explorer/FutureParticipation.tsx - About 55 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 define has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

              public define({
                username,
                firstName,
                lastName,
                picture = defaultProfilePicture,
            Severity: Minor
            Found in app/imports/api/user/AdminProfileCollection.ts - About 55 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 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;

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