radgrad/radgrad2

View on GitHub

Showing 211 of 211 total issues

Function update has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

  public update(
    docID,
    {
      firstName,
      lastName,
Severity: Minor
Found in app/imports/api/user/StudentProfileCollection.ts - About 3 hrs 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 onDragEnd has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

const onDragEnd = (onDragEndProps) => (result) => {
  const { match } = onDragEndProps;
  if (!result.destination) {
    return;
  }
Severity: Minor
Found in app/imports/ui/pages/student/StudentDegreePlannerPage.tsx - About 3 hrs 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 getLevelCriteriaStringMarkdown has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

export const getLevelCriteriaStringMarkdown = (level: string): string => {
  if (!(['six', 'five', 'four', 'three', 'two'].includes(level))) {
    throw new Meteor.Error(`${level} is not a valid level`);
  }
  const criteria = Meteor.settings.public.level[level];
Severity: Minor
Found in app/imports/api/level/LevelProcessor.ts - About 3 hrs 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 22 (exceeds 5 allowed). Consider refactoring.
Open

  public define({ year, student }: AcademicYearInstanceDefine) {
    const studentID = Users.getID(student);
    const quarterSystem = RadGradProperties.getQuarterSystem();
    let termIDs = [];
    // check for gaps
Severity: Minor
Found in app/imports/api/degree-plan/AcademicYearInstanceCollection.ts - About 3 hrs 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 compareTerms has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

export const compareTerms = (term1: string, term2: string): number => {
  const year1 = getYear(term1);
  const year2 = getYear(term2);
  const t1 = getTerm(term1);
  const t2 = getTerm(term2);
Severity: Minor
Found in scripts/ts/fixture-generator/academic-term-utilities.ts - About 2 hrs 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 PageTrackingComparisonWidget has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

const PageTrackingComparisonWidget: React.FC<PageTrackingComparisonWidgetProps> = ({ pageInterestsDailySnapshots }) => {
  const match = useRouteMatch();
  const urlCategory: IPageInterestsCategoryTypes = getUrlCategory(match);

  const [data, setData] = useState<PageInterestInfo[]>(undefined);
Severity: Minor
Found in archive/page-tracking/page-tracking/PageTrackingComparisonWidget.tsx - About 2 hrs 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 descriptionPairs has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

const descriptionPairs = (props: AdminDataModelUsersPageProps) => (user: BaseProfile) => {
  const pairs = [];
  pairs.push({ label: 'Username', value: user.username });
  pairs.push({ label: 'Name', value: `${user.firstName}  ${user.lastName}` });
  pairs.push({ label: 'Role', value: user.role });
Severity: Minor
Found in app/imports/ui/pages/admin/AdminDataModelUsersPage.tsx - About 2 hrs 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 20 (exceeds 5 allowed). Consider refactoring.
Open

  public update(instance: string, {
    name,
    description,
    opportunityType,
    sponsor,
Severity: Minor
Found in app/imports/api/opportunity/OpportunityCollection.ts - About 2 hrs 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 AddUserForm has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

const AddUserForm: React.FC<AddUserProps> = ({ interests, academicTerms, careerGoals }) => {
  const [role, setRole] = useState<string>('');
  let formRef;

  const handleAdd = (doc: CombinedProfileDefine) => {
Severity: Minor
Found in app/imports/ui/components/admin/datamodel/user/AddUserForm.tsx - About 2 hrs 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 19 (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 2 hrs 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 processStarCsvData has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

export const processStarCsvData = (student, csvData) => {
  if (Papa) {
    const parsedData = Papa.parse(csvData);
    if (parsedData.errors.length !== 0) {
      throw new Meteor.Error(`Error found when parsing STAR data for ${student}: ${parsedData.errors}`);
Severity: Minor
Found in app/imports/api/star/StarProcessor.ts - About 2 hrs 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 AdminDataModelUsersPage has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

const AdminDataModelUsersPage: React.FC<AdminDataModelUsersPageProps> = (props) => {
  const [confirmOpenState, setConfirmOpen] = useState(false);
  const [idState, setId] = useState('');
  const [showUpdateFormState, setShowUpdateForm] = useState(false);

Severity: Minor
Found in app/imports/ui/pages/admin/AdminDataModelUsersPage.tsx - About 2 hrs 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 iceRecHelper has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

const iceRecHelper = (student: StudentProfile, value, component): string => {
  let html = '';
  if (value >= 100) {
    html += `Congratulations! You have achieved 100 ${iceMap[component].name} points!`;
    return html;
Severity: Minor
Found in app/imports/ui/pages/admin/AdminAnalyticsNewsletterPage.tsx - About 2 hrs 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 generatePublicProfileDataObject has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

const generatePublicProfileDataObject = (username) => {
  const publicData: PublicProfileData = {};
  if (Meteor.isServer) {
    const profile = Users.getProfile(username);
    const userID = Users.getID(username);
Severity: Minor
Found in app/imports/api/user/StudentProfileCollection.methods.ts - About 2 hrs 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 AdvisorAcademicPlanBuilderWidget has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

const AdvisorAcademicPlanBuilderWidget = (props: IAdvisorAcademicPlanBuilderWidgetProps) => {
  // console.log('AdvisorAcademicPlanBuilderWidget props=%o', props);
  const quarterSystem: boolean = RadGradProperties.getQuarterSystem();
  const initTerms = quarterSystem ? 20 : 15;
  const [choiceList, setChoiceList] = useState([]);

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 16 (exceeds 5 allowed). Consider refactoring.
Open

  public update(docID: string, { urls, position, description, interests, company, location, contact, posted, due, missedUploads }: InternshipUpdate) {
    this.assertDefined(docID);
    const updateData: InternshipUpdateData = {};
    if (urls) {
      if (!Array.isArray(urls)) {
Severity: Minor
Found in app/imports/api/internship/InternshipCollection.ts - About 2 hrs 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 AdvisorUpdateStudentWidget has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

const AdvisorUpdateStudentWidget: React.FC<AdvisorUpdateStudentWidgetProps> = ({ dispatch, interests, careerGoals, usernameDoc, isLoaded, selectedUsername, studentCollectionName }) => {
  const doc = usernameDoc;
  const userID = doc.userID;
  const favCareerGoals = ProfileCareerGoals.findNonRetired({ userID });
  const careerGoalIDs = favCareerGoals.map((fav) => fav.careerGoalID);
Severity: Minor
Found in archive/ui/component/advisor/AdvisorUpdateStudentWidget.tsx - About 2 hrs 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 StudentIceColumn has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

const StudentIceColumn: React.FC<StudentIceColumnProps> = ({ type, profileInterests, courseInstances, opportunityInstances, projectedICE, earnedICE }) => {
  const [verifiedColumnOpenState, setVerifiedColumnOpen] = useState(true);
  const [unVerifiedColumnOpenState, setUnVerifiedColumnOpen] = useState(false);
  const [recommendedColumnOpenState, setRecommendedColumnOpen] = useState(false);

Severity: Minor
Found in archive/ui/component/student/ice/StudentIceColumn.tsx - About 2 hrs 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 15 (exceeds 5 allowed). Consider refactoring.
Open

  public define({
    username,
    firstName,
    lastName,
    picture = defaultProfilePicture,
Severity: Minor
Found in app/imports/api/user/StudentProfileCollection.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 AdminAnalyticsNewsletterPage has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

const AdminAnalyticsNewsletterPage: React.FC = () => {

  const [testNewsletterWorking, setTestNewsletterWorking] = useStickyState('Newsletter.test', false);
  const [levelNewsletterWorking, setLevelNewsletterWorking] = useStickyState('Newsletter.level', false);
  const [allNewsletterWorking, setAllNewsletterWorking] = useStickyState('Newsletter.all', false);
Severity: Minor
Found in app/imports/ui/pages/admin/AdminAnalyticsNewsletterPage.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