Showing 923 of 941 total issues
Function CustomSelect
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const CustomSelect = ({ ref = null, onChange, options, value, isMulti = false, placeholder, noOptionsMessage = "Aucune option", error }) => {
return (
<ReactSelect
ref={ref}
noOptionsMessage={() => noOptionsMessage}
- 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 CardContacts
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export default function CardContacts({ contacts, idServiceDep, getService }) {
const [isOpen, setIsOpen] = useState(false);
const [sortedContacts, setSortedContacts] = useState({});
const [nbCohorts, setNbCohorts] = useState(0);
const [cohorts, setCohorts] = 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 Nav
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export default function Nav({ filter, updateFilter, currentTab, setCurrentTab }) {
const user = useSelector((state) => state.Auth.user);
const [userInTheSameRegion, setUserInTheSameRegion] = useState();
useEffect(() => {
- 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 CustomSelect
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const CustomSelect = ({ ref = null, onChange, options, value, isMulti = false, placeholder, noOptionsMessage = "Aucune option", error }) => {
return (
<ReactSelect
ref={ref}
noOptionsMessage={() => noOptionsMessage}
- 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 PhoneField
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const PhoneField = ({
name = "",
label = "Téléphone",
mode = "readonly",
value = "",
- 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 DesignSystemPage
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export default function DesignSystemPage() {
const [values, setValues] = React.useState({
input1: "",
input1Phone: "",
input1PhoneZone: "",
- 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 ModalExportMail
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export default function ModalExportMail({ isOpen, onSubmit, onCancel }) {
const [isLoading, setIsLoading] = React.useState(false);
const [emails, setEmails] = React.useState([]);
const [value, setValue] = React.useState("");
const [error, setError] = React.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 SelectAction
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export default function SelectAction({ options, value, placeholder, Icon = null, alignItems = "left", onChange }) {
const [open, setOpen] = React.useState(false);
const [selected, setSelected] = React.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 Action
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const Action = ({ hit, structure, displayActionButton, setResponsable }) => {
const user = useSelector((state) => state.Auth.user);
const history = useHistory();
const [modal, setModal] = useState({ isOpen: false, onConfirm: null });
const [modalReferentDeleted, setModalReferentDeleted] = useState({ isOpen: 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 List
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export default function List() {
const [responsable, setResponsable] = useState(null);
const { user, sessionPhase1 } = useSelector((state) => state.Auth);
const [structures, setStructures] = useState();
const [services, setServices] = 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 TabSession
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export default function TabSession({ sessionByCenter, filters }) {
const [sessionData, setSessionData] = React.useState(null);
const [isLoading, setIsLoading] = React.useState(true);
const [page, setPage] = React.useState(0);
const [pageMax, setPageMax] = React.useState(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 ChangeEmailModal
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const ChangeEmailModal = ({ onClose, isOpen, young, validationToken = "" }) => {
const [step, setStep] = useState(changeEmailSteps.ENTER_PASSWORD);
const [password, setPassword] = useState("");
const [newEmail, setNewEmail] = 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 DocumentsPhase1
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export default function DocumentsPhase1({ young }) {
const [isMedicalFileModalOpen, setMedicalFileModalOpen] = useState(false);
const youngStatusPhase1 = getStatusPhase1(young);
// TODO: find a better way to implement feature flags
- 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 IndexPhase2Mobile
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export default function IndexPhase2Mobile() {
const young = useSelector((state) => state.Auth.young);
const [applications, setApplications] = React.useState();
const [toggleButtonDisplayHidden, setToggleButtonDisplayHidden] = React.useState(false);
const [loading, setLoading] = React.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 PageButton
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function PageButton({ page, setCurrentPageNumber, active, lastPage, isLast = false }) {
const getClass = () => {
let classTab = [];
active ? classTab.push("font-bold bg-gray-100 text-gray-900") : classTab.push("font-normal"); // la page est active
page !== lastPage && !isLast ? classTab.push("border-r border-solid border-gray-200") : null; // page par defaut
- 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 DndFileInput
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export default function DndFileInput({
optional,
value,
onChange,
name,
- 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 RoundButton
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export function RoundButton({ children, className = "", onClick = () => {}, spinner = false, icon, href, target, rel, mode = "blue", disabled = false }) {
let color;
switch (mode) {
case "grey":
- 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 Signin
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export default function Signin() {
const [loading, setLoading] = React.useState(false);
const [error, setError] = React.useState({});
const history = useHistory();
const [token2FA, setToken2FA] = React.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 IndexDesktop
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export default function IndexDesktop() {
const young = useSelector((state) => state.Auth.young);
const [applications, setApplications] = React.useState();
const [toggleButtonDisplayHidden, setToggleButtonDisplayHidden] = React.useState(false);
const [loading, setLoading] = React.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 translateError
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export function translateError(path) {
const parts = path.split(".");
const result = translatePart(ERROR_MESSAGES, parts, 0);
return result || path;
- 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"