Showing 211 of 211 total issues
Function findAcademicTermSlug
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const findAcademicTermSlug = (starDataObject: StarDataObject): string => {
const academicTerm = starDataObject.semester;
if ((!_.isString(academicTerm)) || (academicTerm.length < 8)) {
throw new Meteor.Error(`Could not parse academic term data: ${JSON.stringify(starDataObject)}`);
}
- Read upRead up
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 6 (exceeds 5 allowed). Consider refactoring. Open
run(user: string) {
if (Meteor.isServer) {
StudentProfiles.assertValidRoleForMethod(this.userId);
const profile = Users.getProfile(user);
if (profile.role !== ROLE.STUDENT && profile.role !== ROLE.ALUMNI) {
- Read upRead up
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 findDoc
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public findDoc(name: string | { [key: string]: unknown } | { name } | { _id: string; } | { username: string; }) {
if (_.isNull(name) || _.isUndefined(name)) {
throw new Meteor.Error(`${name} is not a defined ${this.type}`);
}
const doc = (
- Read upRead up
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);
- Read upRead up
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 6 (exceeds 5 allowed). Consider refactoring. Open
const descriptionPairs = (item: Review): DescriptionPair[] => {
let reviewee;
if (item.reviewType === ReviewTypes.COURSE) {
reviewee = Courses.findDoc(item.revieweeID);
} else if (item.reviewType === ReviewTypes.OPPORTUNITY) {
- Read upRead up
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();
- Read upRead up
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,
- Read upRead up
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);
- Read upRead up
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);
- Read upRead up
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;
- Read upRead up
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,
- Read upRead up
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"