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,
- 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 onDragEnd
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
const onDragEnd = (onDragEndProps) => (result) => {
const { match } = onDragEndProps;
if (!result.destination) {
return;
}
- 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 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];
- 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 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
- 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 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);
- 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 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);
- 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 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 });
- 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 update
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public update(instance: string, {
name,
description,
opportunityType,
sponsor,
- 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 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) => {
- 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 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}`);
}
- 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 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}`);
- 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 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);
- 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 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;
- 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 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);
- 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 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([]);
- 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 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)) {
- 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 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);
- 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 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);
- 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 define
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public define({
username,
firstName,
lastName,
picture = defaultProfilePicture,
- 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 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);
- 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"