Showing 927 of 945 total issues
Function CardRepresentant
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export default function CardRepresentant({ structure, setStructure }) {
const representant = structure?.structureManager || null;
const [isOpen, setIsOpen] = useState(false);
const handleShowModal = () => setIsOpen(true);
- 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 getPages
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export function getPages(lastDisplayItem, firstDisplayPage, lastDisplayPage, itemsCountTotal, lastPage, size) {
let pages = [];
if (lastDisplayItem === itemsCountTotal) {
// derniere page
for (let i = firstDisplayPage - 1; i <= lastDisplayPage - 1; ++i) pages.push(i);
- 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 ModalChangePresenceJDM
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const ModalChangePresenceJDM = ({ young, value, onConfirm, onLoading, ...rest }) => {
const [isLoading, setIsLoading] = useState(false);
const getTitle = () => {
if (value === "true") return `Marquer ${young.firstName} présent(e) à la JDM`;
- 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 Hit
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const Hit = ({ hit, onClick }) => {
const missionsInfo = {
count: hit.missions ? hit.missions.length : 0,
placesTotal: hit.missions ? hit.missions.reduce((acc, e) => acc + e.placesTotal, 0) : 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 FullDoughnut
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export default function FullDoughnut({
title,
values,
valueSuffix,
labels,
- 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 exploreDir
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
async function exploreDir(basedir, dir, relativeDir) {
const uniqueId = getNextUniqueId();
let context = {
title: dir,
folders: [],
- 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 _handleArgs
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
_handleArgs() {
const args = this._rewriteArgs(process.argv.slice(2));
if (args.find((i) => i === SHORTCUT + "h" || i === OPTION + "help")) {
this._logUsageThenExit(0);
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 Profil
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export default function Profil({ sideBarOpen, user, setOpenInvite }) {
const [isLoggingOut, setIsLoggingOut] = useState(false);
const [isPopoverOpen, setPopoverOpen] = useState(false);
const [from, setFrom] = useState();
const dispatch = useDispatch();
- 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 ModalChangeTravelByPlane
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const ModalChangeTravelByPlane = ({ young, value, onConfirm, onLoading, ...rest }) => {
const [isLoading, setIsLoading] = useState(false);
const getTitle = () => {
if (value === "true") return `Marquer ${young.firstName} comme voyageant en avion.`;
- 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 Line
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const Line = ({ hit, onClick, opened, onSelect, selected }) => {
const [value, setValue] = useState(null);
const [modalPointageFicheSanitaire, setModalPointageFicheSanitaire] = useState({ isOpen: false });
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 HonorCertificate
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function HonorCertificate({ young, cohort }) {
let cniExpired = false;
if (young && young.cohort && young.latestCNIFileExpirationDate) {
const cohortStartingDate = cohort?.dateStart;
if (cohortStartingDate) {
- 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 ModalPointageDepart
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export default function ModalPointageDepart({ isOpen, onSubmit, onCancel, young }) {
const [isLoading, setIsLoading] = React.useState(false);
const [departSejourMotif, setDepartSejourMotif] = React.useState("");
const [departSejourAt, setDepartSejourAt] = React.useState("");
const [departSejourMotifComment, setDepartSejourMotifComment] = 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 AccountSpecialSituationsPage
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const AccountSpecialSituationsPage = () => {
const young = useSelector((state) => state.Auth.young);
const values = {
handicap: (young.handicap || "false") === "true" ? true : 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 Step
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const Step = ({ young: { hasStartedReinscription, reinscriptionStep2023, inscriptionStep2023 } }) => {
const { step } = useParams();
const { isCLE } = useAuth();
const title = isCLE ? "Inscription de l'élève" : "Inscription du volontaire";
const supportLink = `${supportURL}${isCLE ? "/base-de-connaissance/les-classes-engagees" : "/base-de-connaissance/phase-0-les-inscriptions"}`;
- 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 WaitingValidation
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export default function WaitingValidation() {
const { young, isCLE } = useAuth();
const cohort = getCohort(young.cohort);
const history = useHistory();
const dispatch = useDispatch();
- 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 WaitingReinscription
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export default function WaitingReinscription({ reinscriptionOpen }) {
const young = useSelector((state) => state.Auth.young);
const history = useHistory();
let textPrecision;
- 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 Forgot
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export default function Forgot() {
const [done, setDone] = React.useState(false);
const [email, setEmail] = React.useState("");
const [loading, setLoading] = React.useState(false);
const [disabled, setDisabled] = React.useState(true);
- 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 MissionsComponent
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export default function MissionsComponent() {
const young = useSelector((state) => state.Auth.young);
const [filters, setFilters] = React.useState({
search: "",
location: {
- 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 AddressDisplay
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export default function AddressDisplay({ data, updateData, error, correction }) {
const userIsInInscription = window.location.pathname.includes("inscription");
const { isCLE } = useAuth();
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 exploreDir
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
async function exploreDir(basedir, dir, relativeDir) {
const uniqueId = getNextUniqueId();
let context = {
title: dir,
folders: [],
- 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"