Showing 923 of 941 total issues
Function Hit
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const Hit = ({ hit, onClick }) => {
return (
<tr onClick={onClick} className="border-b-[1px] border-y-gray-100 hover:bg-gray-50">
<td className="pl-4 py-3 w-[30%]">
<span className="font-bold text-gray-900 leading-6">{hit.status !== "DELETED" ? `${hit.firstName} ${hit.lastName}` : "Compte supprimé"}</span>
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
export default function List() {
const user = useSelector((state) => state.Auth.user);
const cohorts = useSelector((state) => state.Cohorts);
const [data, setData] = 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 GroupYoungVolumeEditor
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export default function GroupYoungVolumeEditor({ value, className = "", onChange, availableVolume }) {
function decrement() {
if (parseInt(value) > 1) {
onChange && onChange(parseInt(value) - 1);
}
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
export default function List({ open, setOpen, busId }) {
const user = useSelector((state) => state.Auth.user);
const [demandeDeModification, setDemandeDeModification] = React.useState([]);
const [loading, setLoading] = React.useState(false);
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 Index
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export default function Index() {
const user = useSelector((state) => state.Auth.user);
const cohorts = useSelector((state) => state.Cohorts);
//useStates
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
const Hit = ({ hit, selectedCohorts, onClick }) => {
if (!hit) return <div></div>;
return (
<div onClick={onClick} className="flex cursor-pointer items-center border-t-[1px] border-gray-100 py-3 px-4 hover:bg-gray-50">
<div className="flex w-[30%] flex-col gap-1">
- 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 Create
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export default function Create(props) {
const { files, addFiles, deleteFile, error } = useFileUpload();
const [isLoading, setLoading] = useState(false);
const history = useHistory();
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 computeYoungStatuses
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
async function computeYoungStatuses(filter) {
const youngs = await api.post("/elasticsearch/young/aggregate-status/export", {
filters: filter,
});
let lines = [];
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
export default function List({ data }) {
const [currentTab, setCurrentTab] = useState(null);
const [viewData, setViewData] = useState(null);
const [filter, setFilter] = useState();
const [activeStatus, setActiveStatus] = 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 MobileList
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export default function MobileList({ data }) {
const [currentTab, setCurrentTab] = useState(null);
const [viewData, setViewData] = useState(null);
const [filter, setFilter] = useState();
const [activeStatus, setActiveStatus] = 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 InfoDepartement
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export default function InfoDepartement({ department }) {
const [servicesDep, setServicesDep] = useState();
const [contacts, setContacts] = useState();
const [representant, setRepresentant] = 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 formatRate
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function formatRate(value, total, fractionDigit = 0, allowMoreThan100 = false) {
if (total === 0 || total === undefined || total === null || value === undefined || value === null) {
return "-";
} else {
if (value > total && !allowMoreThan100) {
- 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 EngagementList
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function EngagementList() {
const { young } = useSelector((state) => state.Auth);
const applications = useQuery({ queryKey: ["application"], queryFn: () => fetchApplications(young._id) });
const equivalences = useQuery({ queryKey: ["equivalence"], queryFn: () => fetchEquivalences(young._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 FormRepresentant
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const FormRepresentant = ({ i, data, setData, errors, corrections }) => {
return (
<div className="my-4 flex flex-col">
<div className="pb-2 font-bold text-[18px] text-[#161616]">Représentant légal {i} </div>
<div className="pl-3 border-l-4 border-l-indigo-500 text-[#3A3A3A] text-[16px] my-4 leading-6">
- 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 Header
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const Header = ({ title }) => {
const { isCLE, isLoggedIn, loginOrLogout } = useAuth();
const isInscription = location.pathname.includes("inscription");
const quickAccessItems = [
- 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 createFolderView
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function createFolderView(context, imports) {
// --- prepare elements
const components = [];
const title = `<div className="${titleClass}">${context.title}</div>`;
for (const item of context.components) {
- 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 AddressSearch
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export default function AddressSearch({ updateData, label, error }) {
const [query, setQuery] = useState("");
const debouncedQuery = useDebounce(query, 300);
const { results, isError, isPending } = useAddress({ query: debouncedQuery, options: { limit: 10 }, enabled: debouncedQuery.length > 2 });
const dropdownRef = 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 ReInscription
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export default function ReInscription() {
const [isReinscriptionOpen, setReinscriptionOpen] = useState(false);
const [isReinscriptionOpenLoading, setReinscriptionOpenLoading] = useState(true);
const young = useSelector((state) => state.Auth.young);
- 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 Checkbox
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const Checkbox = ({ label = "", className = "", name = "", value = "", useCheckedAsValue = false, onChange = () => null, error = null, ...rest }) => {
if ("type" in rest) {
throw new Error(`Checkbox component cannot handle a custom type.`);
}
- 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 buildApplicationContext
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
async function buildApplicationContext(user) {
const contextFilters = [];
if (!canSearchInElasticSearch(user, "application")) return { applicationContextError: { status: 403, body: { ok: false, code: ERRORS.OPERATION_UNAUTHORIZED } } };
- 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"