Showing 923 of 941 total issues
Function Field
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function Field({ onChange, value, label, disabled = false, error, readOnly = false, copy, placeholder }) {
const [copied, setCopied] = React.useState(false);
React.useEffect(() => {
if (copied) {
- 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 Modification
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function Modification({ demandeDeModification, getModification }) {
const [panel, setPanel] = React.useState({ open: false });
const [tagsOptions, setTagsOptions] = React.useState(null);
const user = useSelector((state) => state.Auth.user);
const history = useHistory();
- 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 Regional
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function Regional() {
const history = useHistory();
const user = useSelector((state) => state.Auth.user);
const cohorts = useSelector((state) => state.Cohorts);
- 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 SelectInput
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function SelectInput({ options, onChange, disabled, placeholder, renderOption, value }) {
const [open, setOpen] = useState(false);
const [searchValue, setSearchValue] = useState("");
const ref = React.useRef(null);
- 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 SchemaRepartitionIndex
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function SchemaRepartitionIndex(props) {
const region = props.match && props.match.params && props.match.params.region;
const department = props.match && props.match.params && props.match.params.department;
const user = useSelector((state) => state.Auth.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 DatePickerList
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function DatePickerList({ value, label, onChange, error = "", disabled = false, readOnly = false, Icon = false }) {
return (
<div className={`flex w-full flex-col rounded-lg border-[1px] border-gray-300 py-2 px-2.5 ${disabled ? "bg-gray-100" : ""} ${error ? "border-red-500" : ""}`}>
<div className="flex w-full items-center gap-x-2">
{Icon ? <Icon className="h-4 w-4 text-gray-400" /> : null}
- 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 From
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const From = ({ allLines, isDirty, selectedMeetingPoint, setSelectedMeetingPoint, selectedLigne, setSelectedLigne, checkedYoungs, setCheckedYoungs, cohort }) => {
const [meetingPointsOptions, setMeetingPointsOptions] = useState([]);
const [meetingPoints, setMeetingPoints] = useState([]);
const urlParams = new URLSearchParams(window.location.search);
const [youngsFilter, setYoungsFilter] = 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 Field
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const Field = ({ onChange, value, label, disabled = false, error, readOnly = false, copy, className = "", eye = null }) => {
const [copied, setCopied] = React.useState(false);
const [eyeVisible, setEyeVisible] = React.useState(false);
React.useEffect(() => {
if (copied) {
- 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 DeletedInscriptionPanel
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function DeletedInscriptionPanel({ onChange, value }) {
const [young, setYoung] = useState(null);
useEffect(() => {
(async () => {
- 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 StepsAffected
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function StepsAffected({ data }) {
const { isCLE, young } = useAuth();
if (!young) return <div />;
function handleClick() {
- 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 PDRModal
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function PDRModal({ open, setOpen, meetingPoints, center, session, pdrChoiceExpired }) {
const young = useSelector((state) => state.Auth.young);
const cohort = getCohort(young.cohort);
const dispatch = useDispatch();
const [modalMeetingPoint, setModalMeetingPoint] = useState({ isOpen: false, meetingPoint: null });
- 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 General
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function General({ updateFilter, focusedSession, filterArray, setHasYoungValidated }) {
const [young, setYoung] = useState();
//List state
const pageId = "pointage-list";
- 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 Programs
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function Programs() {
const [open, setOpen] = useState(false);
const { isPending, error, data } = useQuery({ queryKey: ["program"], queryFn: fetchPrograms });
if (isPending) return <Loader />;
- 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 hasAccessToPhase2
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function hasAccessToPhase2(young) {
if (!young) return false;
if (young.statusPhase2 === "VALIDATED") return true;
if (young.status === YOUNG_STATUS.WITHDRAWN) return false;
const userIsDoingAMission = young.phase2ApplicationStatus.some((status) => ["VALIDATED", "IN_PROGRESS"].includes(status));
- 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 Done
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function Done() {
const { young, isCLE } = useAuth();
const history = useHistory();
async function handleClick() {
try {
- 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 ToutSavoir
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function ToutSavoir({ data }) {
const [open, setOpen] = useState(!data.publisherName);
return (
<section id="tout-savoir" className="mt-4 rounded-xl border p-3">
- 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 MenuItem
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function MenuItem({ to, enabled = true, icon, text, status, onClose, ticketCount }) {
const isActive = location.pathname.includes(to) && (to !== "/" || location.pathname === "/");
if (enabled) {
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 Index
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function Index() {
const young = useSelector((state) => state.Auth.young);
const [infosHover, setInfosHover] = useState(false);
const [infosClick, setInfosClick] = useState(false);
const toggleInfos = () => {
- 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 Account
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const Account = () => {
useDocumentTitle("Mon profil");
const { young } = useAuth();
const ACCOUNT_PAGES = {
- 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 AccountSchoolSituationPage
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const AccountSchoolSituationPage = () => {
const { young, isCLE } = useAuth();
const {
isPending,
isError,
- 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"