radgrad/radgrad2

View on GitHub

Showing 211 of 211 total issues

Function run has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  run({ username, fieldName, fieldValue }) {
    // console.log(username, fieldName, fieldValue);
    if (Meteor.isServer) {
      const profile = Users.getProfile(username);
      let profileCollection;
Severity: Minor
Found in app/imports/api/user/StudentProfileCollection.methods.ts - About 25 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 ExplorerCard has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const ExplorerCard: React.FC<ExplorerCardProps> = ({ item, type, inProfile }) => {
  const match = useRouteMatch();
  const itemName = (type === EXPLORER_TYPE.COURSES) ? Courses.getName(item._id) : docToName(item);
  const itemShortDescription = docToShortDescription(item);
  const slugName = itemToSlugName(item);
Severity: Minor
Found in app/imports/ui/components/shared/explorer/browser-view/ExplorerCard.tsx - About 25 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 getID has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  public getID(instance) {
    let id;
    // If we've been passed a document, check to see if it has an _id field and use that if available.
    if (_.isObject(instance) && _.has(instance, '_id')) {
      // @ts-ignore
Severity: Minor
Found in app/imports/api/user/BaseProfileCollection.ts - About 25 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 OpportunityInformationItem has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const OpportunityInformationItem: React.FC<OpportunityItemWidgetProps> = ({
  informationConfiguration,
  opportunity,
}) => {
  const match = useRouteMatch();
Severity: Minor
Found in archive/issue-399/OpportunityInformationItem.tsx - About 25 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 removeAllEntities has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export const removeAllEntities = (): boolean => {
  if (Meteor.isTest || Meteor.isAppTest) {
    // assertIntegrity();  // this started failing after update to Meteor 1.6.1!
    RadGrad.collections.forEach((collection) => {
      if (collection.type !== 'AdminProfile') {
Severity: Minor
Found in app/imports/api/base/BaseUtilities.ts - About 25 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 UploadFixture has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const UploadFixture: React.FC = () => {
  const [fileDataState, setFileData] = useState('');
  const [uploadResult, setUploadResult] = useState('');
  const [error, setError] = useState(false);
  const [uploadFixtureWorking, setUploadFixtureWorking] = useStickyState('UploadFixture', false);
Severity: Minor
Found in app/imports/ui/components/admin/database/UploadFixture.tsx - About 25 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 recommendedEvents has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const recommendedEvents = (projectedPoints: number, profileInterests: ProfileInterest[], type, match): any[] => {
  if (getUserIdFromRoute(match)) {
    let allInstances: any[];
    const recommendedInstances = [];
    let totalIce = 0;
Severity: Minor
Found in archive/ui/component/student/ice/StudentIceColumnRecommended.tsx - About 25 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 StudentIceColumnRecommended has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const StudentIceColumnRecommended: React.FC<StudentIceColumnRecommendedProps> = ({
  earnedICEPoints,
  type,
  profileInterests,
  getCourseSlug,
Severity: Minor
Found in archive/ui/component/student/ice/StudentIceColumnRecommended.tsx - About 25 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 InterestBrowserView has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const InterestBrowserView: React.FC<InterestBrowserViewProps> = ({
  interests,
  inProfile,
  interestsScrollPosition,
  setInterestsScrollPosition,
Severity: Minor
Found in archive/issue-398/InterestBrowserView.tsx - About 25 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 DetailOpportunityCard has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const DetailOpportunityCard: React.FC<DetailOpportunityCardProps> = ({ instance, verificationRequests }) => {
  const [, setSelectedCiID] = useStickyState(DegreePlannerStateNames.selectedCiID, '');
  const [, setSelectedOiID] = useStickyState(DegreePlannerStateNames.selectedOiID, '');
  const [, setSelectedProfileTab] = useStickyState(DegreePlannerStateNames.selectedProfileTab, '');
  const verificationRequestsToShow = verificationRequests.filter((vr) => vr.opportunityInstanceID === instance._id);
Severity: Minor
Found in archive/ui/component/shared/DetailOpportunityCard.tsx - About 25 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 generateRecommendedCurrentAcademicTermOpportunities has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  public generateRecommendedCurrentAcademicTermOpportunities(user: string) {
    const functionName = 'generateRecommendedCurrentAcademicTermOpportunities';
    // console.log(`Running feedback function ${functionName}`);
    const feedbackType = FeedbackInstances.RECOMMENDATION;
    const studentID = Users.getID(user);
Severity: Minor
Found in archive/api/feedback/FeedbackFunctions.ts - About 25 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