radgrad/radgrad2

View on GitHub

Showing 205 of 205 total issues

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;
Severity: Minor
Found in archive/issue-410/AddCareerGoalToProfileButton.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 processStarJsonData has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

export const processStarJsonData = (student, jsonData) => {
  // console.log(jsonData);
  if (student !== jsonData.email) {
    throw new Meteor.Error(`JSON data is not for ${student}`);
  }
Severity: Minor
Found in app/imports/api/star/StarProcessor.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 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}`);
    }
Severity: Minor
Found in app/imports/api/academic-term/AcademicTermCollection.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 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) {
Severity: Minor
Found in app/imports/api/verification/VerificationRequestCollection.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 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);

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();

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) => {
Severity: Minor
Found in app/imports/ui/components/landing/RadGradLoginButtons.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 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);
Severity: Minor
Found in app/imports/ui/pages/SigninPage.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 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) {
Severity: Minor
Found in archive/api/log/AdvisorLogCollection.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

Consider simplifying this complex logical expression.
Open

  } else if (earnedICE.i >= 80 &&
    earnedICE.c >= 80 &&
    earnedICE.e >= 80 &&
    numReviews >= 1 &&
    plannedICE.i >= 100 &&
Severity: Critical
Found in app/imports/api/level/LevelProcessor.ts - About 1 hr to fix

    Consider simplifying this complex logical expression.
    Open

      if (earnedICE.i >= 100 &&
        earnedICE.c >= 100 &&
        earnedICE.e >= 100 &&
        numReviews >= 6 &&
        plannedICE.i >= 100 &&
    Severity: Critical
    Found in app/imports/api/level/LevelProcessor.ts - About 1 hr to fix

      Consider simplifying this complex logical expression.
      Open

        } else if (earnedICE.i >= 30 &&
          earnedICE.c >= 36 &&
          earnedICE.e >= 30 &&
          numReviews >= 0 &&
          plannedICE.i >= 100 &&
      Severity: Critical
      Found in app/imports/api/level/LevelProcessor.ts - About 1 hr to fix

        Function getCurrentTerm has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

        export const getCurrentTerm = (academicTerms) => {
          const isQuarter = isQuarterSystem(academicTerms);
          let fallStart;
          let springStart;
          let summerStart;
        Severity: Minor
        Found in scripts/ts/fixture-generator/academic-term-utilities.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 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 PictureField has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

        const PictureField: React.FC<TextFieldProps> = ({
          autoComplete,
          className,
          disabled,
          error,
        Severity: Minor
        Found in app/imports/ui/components/form-fields/PictureField.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 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 toString has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

          public toString(planChoice: string) {
            let ret = '';
            let slug;
            const countIndex = planChoice.indexOf('-');
            if (countIndex === -1) {
        Severity: Minor
        Found in app/imports/api/degree-plan/PlanChoiceCollection.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 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;
        Severity: Minor
        Found in scripts/ts/fixture-generator/AcademicTermCollection.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 UpdateUserForm has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

        const UpdateUserForm: React.FC<UpdateUserProps> = ({
          id,
          interests,
          careerGoals,
          academicTerms,
        Severity: Minor
        Found in app/imports/ui/components/admin/datamodel/user/UpdateUserForm.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

        Severity
        Category
        Status
        Source
        Language