betagouv/service-national-universel

View on GitHub

Showing 923 of 941 total issues

File index.jsx has 933 lines of code (exceeds 700 allowed). Consider refactoring.
Open

import React, { useState, useEffect } from "react";
import { MdInfoOutline } from "react-icons/md";
import { useSelector } from "react-redux";
import { toastr } from "react-redux-toastr";
import { useHistory } from "react-router-dom";
Severity: Major
Found in admin/src/scenes/settings/index.jsx - About 7 hrs to fix

    Function StructureForm has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
    Open

    function StructureForm({ structure, setStructure }) {
      const user = useSelector((state) => state.Auth.user);
      const [data, setData] = useState(structure);
      const [isEditing, setIsEditing] = useState(false);
      const [isLoading, setIsLoading] = useState(false);
    Severity: Minor
    Found in admin/src/scenes/structure/view/detailsV2.jsx - About 7 hrs to fix

    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 sync has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
    Open

    const sync = async (result) => {
      if (!result.ok) {
        throw new Error("sync with JVA missions : " + result.code);
      }
    
    
    Severity: Minor
    Found in api/src/crons/JeVeuxAiderDaily.js - About 7 hrs to fix

    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

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

            <ul className="mt-[8px]">
              <li>
                <a href="https://www.gouvernement.fr/" target="_blank" rel="noreferrer">
                  gouvernement.fr
                </a>
    Severity: Major
    Found in admin/src/components/footer.jsx and 1 other location - About 7 hrs to fix
    app/src/components/footer.jsx on lines 37..73

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 289.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

            <ul>
              <li>
                <a href="https://www.gouvernement.fr/" target="_blank" rel="noreferrer">
                  gouvernement.fr
                </a>
    Severity: Major
    Found in app/src/components/footer.jsx and 1 other location - About 7 hrs to fix
    admin/src/components/footer.jsx on lines 51..87

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 289.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Function ViewDesktop has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
    Open

    export default function ViewDesktop() {
      const [mission, setMission] = useState();
      const [modal, setModal] = useState(null);
      const [loading, setLoading] = useState(false);
      const [contract, setContract] = useState(null);
    Severity: Minor
    Found in app/src/scenes/missions/viewDesktop.jsx - About 7 hrs to fix

    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

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

    async function exploreDir(basedir, dir, relativeDir) {
      const uniqueId = getNextUniqueId();
      let context = {
        title: dir,
        folders: [],
    Severity: Major
    Found in admin/src/utils/generate-assets-presentation-page.js and 1 other location - About 7 hrs to fix
    app/src/utils/generate-assets-presentation-page.js on lines 33..58

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 286.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

    async function exploreDir(basedir, dir, relativeDir) {
      const uniqueId = getNextUniqueId();
      let context = {
        title: dir,
        folders: [],
    Severity: Major
    Found in app/src/utils/generate-assets-presentation-page.js and 1 other location - About 7 hrs to fix
    admin/src/utils/generate-assets-presentation-page.js on lines 33..58

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 286.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

      describe("GET /structure/:id/patches", () => {
        it("should return 404 if structure not found", async () => {
          const res = await request(getAppHelper()).get(`/structure/${notExistingStructureId}/patches`).send();
          expect(res.statusCode).toEqual(404);
        });
    Severity: Major
    Found in api/src/__tests__/structure.test.ts and 1 other location - About 7 hrs to fix
    api/src/__tests__/mission.test.ts on lines 185..214

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 436.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

      describe("GET /mission/:id/patches", () => {
        it("should return 404 if mission not found", async () => {
          const res = await request(getAppHelper()).get(`/mission/${notExisitingMissionId}/patches`).send();
          expect(res.statusCode).toEqual(404);
        });
    Severity: Major
    Found in api/src/__tests__/mission.test.ts and 1 other location - About 7 hrs to fix
    api/src/__tests__/structure.test.ts on lines 118..147

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 436.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Function Todos has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
    Open

    export default function Todos({ user }) {
      const [fullNote, setFullNote] = useState(false);
      const [stats, setStats] = useState({});
      const cohorts = useSelector((state) => state.Cohorts);
      const cohortsNotFinished = cohorts.filter((c) => new Date(c.dateEnd) > Date.now())?.map((e) => e.name);
    Severity: Minor
    Found in admin/src/scenes/dashboardV2/components/Todos.jsx - About 7 hrs to fix

    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 CniModal has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
    Open

    export function CniModal({ young, onClose, mode, blockUpload }) {
      const [confirmDeleteModal, setConfirmDeleteModal] = useState(null);
      const [error, setError] = useState(null);
      const [changes, setChanges] = useState(false);
      const [cniFiles, setCniFiles] = useState([]);
    Severity: Minor
    Found in admin/src/scenes/phase0/components/CniModal.jsx - About 7 hrs to fix

    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 BusTeam has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
    Open

    export default function BusTeam({ bus, setBus, title, role, addOpen, setAddOpen, idTeam, cohort }) {
      const user = useSelector((state) => state.Auth.user);
      const [editInfo, setEditInfo] = React.useState(false);
      const [isLoading, setIsLoading] = React.useState(false);
      const [errors, setErrors] = React.useState({});
    Severity: Minor
    Found in admin/src/scenes/plan-transport/ligne-bus/View/components/BusTeam.jsx - About 7 hrs to fix

    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

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

    const SendContractByMail = ({ young, contractId, missionName }) => {
      const [modalMail, setModalMail] = useState({ isOpen: false, onConfirm: null });
    
      const onConfirm = async () => {
        try {
    Severity: Major
    Found in app/src/scenes/missions/viewMobile.jsx and 1 other location - About 7 hrs to fix
    app/src/scenes/missions/viewDesktop.jsx on lines 688..731

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 433.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

    const SendContractByMail = ({ young, contractId, missionName }) => {
      const [modalMail, setModalMail] = useState({ isOpen: false, onConfirm: null });
    
      const onConfirm = async () => {
        try {
    Severity: Major
    Found in app/src/scenes/missions/viewDesktop.jsx and 1 other location - About 7 hrs to fix
    app/src/scenes/missions/viewMobile.jsx on lines 727..770

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 433.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 3 locations. Consider refactoring.
    Open

      const handleUpload = (event) => {
        const files = event.target.files;
        for (let index = 0; index < Object.keys(files).length; index++) {
          let i = Object.keys(files)[index];
          if (!isFileSupported(files[i].name)) return toastr.error(`Le type du fichier ${files[i].name} n'est pas supporté.`);
    Severity: Major
    Found in admin/src/scenes/volontaires/view/FormEquivalence.jsx and 2 other locations - About 7 hrs to fix
    admin/src/scenes/volontaires/components/ModalFilesEquivalence.jsx on lines 41..55
    app/src/scenes/phase2/scenes/MonEquivalence/EditEquivalence.jsx on lines 45..59

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 281.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 3 locations. Consider refactoring.
    Open

      const handleUpload = (event) => {
        const files = event.target.files;
        for (let index = 0; index < Object.keys(files).length; index++) {
          let i = Object.keys(files)[index];
          if (!isFileSupported(files[i].name)) return toastr.error(`Le type du fichier ${files[i].name} n'est pas supporté.`);
    admin/src/scenes/volontaires/view/FormEquivalence.jsx on lines 44..58
    app/src/scenes/phase2/scenes/MonEquivalence/EditEquivalence.jsx on lines 45..59

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 281.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

        if (isReferent(req.user)) {
          if (!canCreateYoungApplication(req.user, young)) {
            return res.status(403).send({ ok: false, code: ERRORS.OPERATION_NOT_ALLOWED });
          }
          if (req.user.role === ROLES.RESPONSIBLE) {
    Severity: Major
    Found in api/src/controllers/application.js and 1 other location - About 7 hrs to fix
    api/src/controllers/application.js on lines 542..559

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 431.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

        if (isReferent(req.user)) {
          if (!canCreateYoungApplication(req.user, young)) {
            return res.status(403).send({ ok: false, code: ERRORS.OPERATION_NOT_ALLOWED });
          }
          if (req.user.role === ROLES.RESPONSIBLE) {
    Severity: Major
    Found in api/src/controllers/application.js and 1 other location - About 7 hrs to fix
    api/src/controllers/application.js on lines 345..362

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 431.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

    export default function IconDomain({ domain, bgStyle = null, iconStyle = "text-white h-8 w-8" }) {
      const [icon, setIcon] = React.useState(null);
    
      React.useEffect(() => {
        switch (domain) {
    Severity: Major
    Found in admin/src/components/IconDomainRounded.jsx and 1 other location - About 7 hrs to fix
    admin/src/components/IconDomain.jsx on lines 14..59

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 431.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Severity
    Category
    Status
    Source
    Language