Showing 923 of 941 total issues
Function exports
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
module.exports = (data) => {
return (req, res, next) => {
try {
if (typeof data.validate !== "function") data = Joi.object(data);
const { error, value } = data.validate(req.body);
- 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 Details
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const Details = ({ title, value, copy }) => {
if (!value) return <div />;
const [copied, setCopied] = React.useState(false);
if (typeof value === "function") value = value();
React.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 MultiSelect
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function MultiSelect({ options, selected, setSelected, label, readOnly = false, icon, error }) {
const border = (open) => {
if (readOnly) return "border-gray-200";
if (error) return "border-red-500";
if (open) return "border-blue-500";
- 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 InputNumber
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function InputNumber({ register, name, label, disabled = false, error = "", readOnly = false, placeholder = "", validation = {} }) {
return (
<div
className={`flex min-h-[54px] w-full flex-col justify-center rounded-lg border-[1px] bg-white py-2 px-2.5 ${disabled ? "border-gray-200" : "border-gray-300"} ${
error ? "border-red-500" : ""
- 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 Select
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function Select({ options, selected, setSelected, label, readOnly = false, icon, error }) {
const border = (open) => {
if (readOnly) return "border-gray-200";
if (error) return "border-red-500";
if (open) return "border-blue-500";
- 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
export default function Field({ onChange, value, label, disabled = false, error, readOnly = false, copy }) {
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 VolontaireList
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function VolontaireList() {
const user = useSelector((state) => state.Auth.user);
const history = useHistory();
if (user?.role === ROLES.ADMINISTRATEUR_CLE) return history.push("/mes-eleves");
- 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 HorizontalBar
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function HorizontalBar({ title, values, labels, showTooltips = false, legendUrls, goal, className = "", onLegendClicked = () => {} }) {
const [bars, setBars] = useState([]);
const [total, setTotal] = useState(0);
const [totalPercent, setTotalPercent] = useState("-");
const [x100, setX100] = useState(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 SignupInvite
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function SignupInvite() {
const [invitation, setInvitation] = useState("");
const [newuser, setNewUser] = useState(null);
const urlParams = new URLSearchParams(window.location.search);
- 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 currentFilterAsUrl
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const currentFilterAsUrl = (filters) => {
let selectedFilters = {};
Object.keys(filters)?.forEach((key) => {
if (filters[key]?.length > 0) selectedFilters[key] = filters[key];
});
- 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 translateHistory
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function translateHistory(path, value) {
if (path.includes("statusPhase1")) {
return translatePhase1(value);
} else if (path.includes("statusPhase2")) {
return translatePhase2(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 InputText
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function InputText({ register, name, label, disabled = false, error = "", readOnly = false, placeholder = "", validation = {} }) {
return (
<div
className={`flex min-h-[54px] w-full flex-col justify-center rounded-lg border-[1px] bg-white py-2 px-2.5 ${disabled ? "border-gray-200" : "border-gray-300"} ${
error ? "border-red-500" : ""
- 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 InputText
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function InputText({ onChange, value, label, disabled = false, error, readOnly = false, placeholder }) {
return (
<div
className={`flex min-h-[54px] w-full flex-col justify-center rounded-lg border-[1px] bg-white py-2 px-2.5 ${disabled ? "border-gray-200" : "border-gray-300"} ${
error ? "border-red-500" : ""
- 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 Select
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function Select({ options, value, onChange, label, readOnly = false, icon, error }) {
const border = (open) => {
if (readOnly) return "border-gray-200";
if (error) return "border-red-500";
if (open) return "border-blue-500";
- 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 TotalInscription
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function TotalInscription({ totalInscriptions, goal }) {
const dataInscription = totalInscriptions?.reduce((acc, curr) => {
if (!acc.length) {
acc.push(curr.doc_count);
} else {
- 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 formatPhoneE164
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const formatPhoneE164 = (phone, phoneZone) => {
if (!phone) {
return;
}
if (typeof phone !== "string") {
- 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 PanelView
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function PanelView({ onChange, value, application }) {
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 DeletedVolontairePanel
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function DeletedVolontairePanel({ 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 ExportComponent
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function ExportComponent({
handleClick,
title,
exportTitle,
route,
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
export default function List() {
const user = useSelector((state) => state.Auth.user);
const [structures, setStructures] = useState();
const [responsable, setResponsable] = useState(null);
const [NewUserOpen, setNewUserOpen] = 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"