{"meta":{"title":"Guide de démarrage rapide pour l'évaluation de la qualité du code sur GitHub","intro":"Passez en revue les résultats de la qualité du code, générez une Copilot correction automatique et fusionnez une requête de tirage pour améliorer la fiabilité et la maintenabilité avec GitHub Code Quality.","product":"Sécurité et qualité du code","breadcrumbs":[{"href":"/fr/code-security","title":"Sécurité et qualité du code"},{"href":"/fr/code-security/tutorials","title":"Tutorials"},{"href":"/fr/code-security/tutorials/improve-code-quality","title":"Améliorer la qualité du code"},{"href":"/fr/code-security/tutorials/improve-code-quality/quickstart","title":"Démarrage rapide"}],"documentType":"article"},"body":"# Guide de démarrage rapide pour l'évaluation de la qualité du code sur GitHub\n\nPassez en revue les résultats de la qualité du code, générez une Copilot correction automatique et fusionnez une requête de tirage pour améliorer la fiabilité et la maintenabilité avec GitHub Code Quality.\n\n<!-- TRANSLATION_FALLBACK prop=markdown type=TokenizationError line=1 col=1 msg=\"Syntax Error in 'ifversion' with range - Valid syntax: ifversion [plan] [operator] [releaseNumber], line:1, col:1\" -->\n## Introduction\n\nGitHub Code Quality (public preview) helps keep your code reliable and maintainable by surfacing code quality findings in pull requests and on your default branch.\n\nIn this tutorial, you’ll learn how to identify and fix a code quality finding on your default branch, helping to improve your repository’s code health.\n\n### Prerequisites\n\n* GitHub Code Quality must be enabled for your repository and you must have code in a supported language. See [Enabling GitHub Code Quality](/en/code-security/code-quality/how-tos/enable-code-quality).\n* If you're enabling GitHub Code Quality for the first time, ensure you've waited a few minutes after enablement for a full CodeQL scan of the default branch to complete.\n\n## Review scan results for your default branch\n\nIn your repository, go to the **<svg version=\"1.1\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" class=\"octicon octicon-shield\" aria-label=\"shield\" role=\"img\"><path d=\"M7.467.133a1.748 1.748 0 0 1 1.066 0l5.25 1.68A1.75 1.75 0 0 1 15 3.48V7c0 1.566-.32 3.182-1.303 4.682-.983 1.498-2.585 2.813-5.032 3.855a1.697 1.697 0 0 1-1.33 0c-2.447-1.042-4.049-2.357-5.032-3.855C1.32 10.182 1 8.566 1 7V3.48a1.75 1.75 0 0 1 1.217-1.667Zm.61 1.429a.25.25 0 0 0-.153 0l-5.25 1.68a.25.25 0 0 0-.174.238V7c0 1.358.275 2.666 1.057 3.86.784 1.194 2.121 2.34 4.366 3.297a.196.196 0 0 0 .154 0c2.245-.956 3.582-2.104 4.366-3.298C13.225 9.666 13.5 8.36 13.5 7V3.48a.251.251 0 0 0-.174-.237l-5.25-1.68ZM8.75 4.75v3a.75.75 0 0 1-1.5 0v-3a.75.75 0 0 1 1.5 0ZM9 10.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z\"></path></svg> Security and quality** tab, click **<svg version=\"1.1\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" class=\"octicon octicon-code-review\" aria-label=\"code review\" role=\"img\"><path d=\"M1.75 1h12.5c.966 0 1.75.784 1.75 1.75v8.5A1.75 1.75 0 0 1 14.25 13H8.061l-2.574 2.573A1.458 1.458 0 0 1 3 14.543V13H1.75A1.75 1.75 0 0 1 0 11.25v-8.5C0 1.784.784 1 1.75 1ZM1.5 2.75v8.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-8.5a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25Zm5.28 1.72a.75.75 0 0 1 0 1.06L5.31 7l1.47 1.47a.751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018l-2-2a.75.75 0 0 1 0-1.06l2-2a.75.75 0 0 1 1.06 0Zm2.44 0a.75.75 0 0 1 1.06 0l2 2a.75.75 0 0 1 0 1.06l-2 2a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L10.69 7 9.22 5.53a.75.75 0 0 1 0-1.06Z\"></path></svg> Code quality** in the left sidebar, then click **Standard findings** to open the repository dashboard.\n\nHere you'll see:\n\n* Ratings for the **Reliability** and **Maintainability** of your codebase, which help you understand your code health at a glance.\n* A **results list** of all the quality issues detected by a CodeQL-powered analysis on your default branch, which are grouped by rule and language.\n\n  ![Screenshot of code quality ratings in the \"Standard findings\" view for Code Quality.](/assets/images/help/code-quality/all-findings-overview-repo.png)\n\n## Identify a high-impact finding\n\nUse the **dashboard filters** to identify a high severity level finding (\"Error\" or \"Warning\").\n\nResolving these will have the biggest impact on your repository's ratings.\n\n![Screenshot showing the dashboard filters for the \"Standard findings\" view.](/assets/images/help/code-quality/standard-findings-filters.png)\n\n### Inspect the details of the finding\n\nClick the rule name itself to see a detailed view of the files and lines of code affected by that rule.\n\n![Screenshot showing a rule in the \"Standard findings\" view. The rule name is highlighted in dark orange.](/assets/images/help/code-quality/click-rule-name.png)\n\nOnce you're in the detailed view, click **Show more** to gather context and understand the results.\n\n![Screenshot of the findings for the \"Overwritten property\" rule. The text, \"Show more\", is highlighted in dark orange.](/assets/images/help/code-quality/click-show-more.png)\n\n## Generate a Copilot Autofix\n\nTo the right of a highlighted finding, click **<svg version=\"1.1\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" class=\"octicon octicon-copilot\" aria-label=\"copilot\" role=\"img\"><path d=\"M7.998 15.035c-4.562 0-7.873-2.914-7.998-3.749V9.338c.085-.628.677-1.686 1.588-2.065.013-.07.024-.143.036-.218.029-.183.06-.384.126-.612-.201-.508-.254-1.084-.254-1.656 0-.87.128-1.769.693-2.484.579-.733 1.494-1.124 2.724-1.261 1.206-.134 2.262.034 2.944.765.05.053.096.108.139.165.044-.057.094-.112.143-.165.682-.731 1.738-.899 2.944-.765 1.23.137 2.145.528 2.724 1.261.566.715.693 1.614.693 2.484 0 .572-.053 1.148-.254 1.656.066.228.098.429.126.612.012.076.024.148.037.218.924.385 1.522 1.471 1.591 2.095v1.872c0 .766-3.351 3.795-8.002 3.795Zm0-1.485c2.28 0 4.584-1.11 5.002-1.433V7.862l-.023-.116c-.49.21-1.075.291-1.727.291-1.146 0-2.059-.327-2.71-.991A3.222 3.222 0 0 1 8 6.303a3.24 3.24 0 0 1-.544.743c-.65.664-1.563.991-2.71.991-.652 0-1.236-.081-1.727-.291l-.023.116v4.255c.419.323 2.722 1.433 5.002 1.433ZM6.762 2.83c-.193-.206-.637-.413-1.682-.297-1.019.113-1.479.404-1.713.7-.247.312-.369.789-.369 1.554 0 .793.129 1.171.308 1.371.162.181.519.379 1.442.379.853 0 1.339-.235 1.638-.54.315-.322.527-.827.617-1.553.117-.935-.037-1.395-.241-1.614Zm4.155-.297c-1.044-.116-1.488.091-1.681.297-.204.219-.359.679-.242 1.614.091.726.303 1.231.618 1.553.299.305.784.54 1.638.54.922 0 1.28-.198 1.442-.379.179-.2.308-.578.308-1.371 0-.765-.123-1.242-.37-1.554-.233-.296-.693-.587-1.713-.7Z\"></path><path d=\"M6.25 9.037a.75.75 0 0 1 .75.75v1.501a.75.75 0 0 1-1.5 0V9.787a.75.75 0 0 1 .75-.75Zm4.25.75v1.501a.75.75 0 0 1-1.5 0V9.787a.75.75 0 0 1 1.5 0Z\"></path></svg> Generate fix**.\n\n![Screenshot of the \"Generate fix\" button.](/assets/images/help/code-quality/generate-fix.png)\n\nReview the suggested fix, then click **Open pull request**.\n\n### Merge the fix\n\nCarefully review the draft pull request. If you're satisfied with the proposed changes, and all checks and tests are passing, go ahead and merge the pull request.\n\n## Observe the metrics change\n\nReturn to the Code Quality dashboard (**<svg version=\"1.1\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" class=\"octicon octicon-shield\" aria-label=\"shield\" role=\"img\"><path d=\"M7.467.133a1.748 1.748 0 0 1 1.066 0l5.25 1.68A1.75 1.75 0 0 1 15 3.48V7c0 1.566-.32 3.182-1.303 4.682-.983 1.498-2.585 2.813-5.032 3.855a1.697 1.697 0 0 1-1.33 0c-2.447-1.042-4.049-2.357-5.032-3.855C1.32 10.182 1 8.566 1 7V3.48a1.75 1.75 0 0 1 1.217-1.667Zm.61 1.429a.25.25 0 0 0-.153 0l-5.25 1.68a.25.25 0 0 0-.174.238V7c0 1.358.275 2.666 1.057 3.86.784 1.194 2.121 2.34 4.366 3.297a.196.196 0 0 0 .154 0c2.245-.956 3.582-2.104 4.366-3.298C13.225 9.666 13.5 8.36 13.5 7V3.48a.251.251 0 0 0-.174-.237l-5.25-1.68ZM8.75 4.75v3a.75.75 0 0 1-1.5 0v-3a.75.75 0 0 1 1.5 0ZM9 10.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z\"></path></svg> Security and quality** tab, then **<svg version=\"1.1\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" class=\"octicon octicon-code-review\" aria-label=\"code review\" role=\"img\"><path d=\"M1.75 1h12.5c.966 0 1.75.784 1.75 1.75v8.5A1.75 1.75 0 0 1 14.25 13H8.061l-2.574 2.573A1.458 1.458 0 0 1 3 14.543V13H1.75A1.75 1.75 0 0 1 0 11.25v-8.5C0 1.784.784 1 1.75 1ZM1.5 2.75v8.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-8.5a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25Zm5.28 1.72a.75.75 0 0 1 0 1.06L5.31 7l1.47 1.47a.751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018l-2-2a.75.75 0 0 1 0-1.06l2-2a.75.75 0 0 1 1.06 0Zm2.44 0a.75.75 0 0 1 1.06 0l2 2a.75.75 0 0 1 0 1.06l-2 2a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L10.69 7 9.22 5.53a.75.75 0 0 1 0-1.06Z\"></path></svg> Code quality**, then **Standard findings**).\n\nWait a few minutes for the next scan to complete — Code Quality scans automatically re-run after every push to the default branch.\n\nObserve the change in metrics at the top of the dashboard:\n\n* The **number of findings** for \"Reliability\" or \"Maintainability\" should have decreased.\n* Your **ratings** for \"Reliability\" or \"Maintainability\" may have improved, if your fix addressed a number of high-impact findings.\n\n  To understand more about how the ratings are calculated, see [Metrics and ratings reference](/en/code-security/code-quality/reference/metrics-and-ratings).\n\n## Conclusion\n\nYou've successfully used Code Quality and Copilot Autofix to improve your repository's code health!\n\nHealthy code is easier to understand, maintain, and extend, and remediating code quality issues makes your codebase more reliable, compliant, and accelerates future development.\n\n## Next steps\n\n* Learn how GitHub Code Quality works on pull requests to prevent code quality issues from reaching your default branch. See [Fixing code quality findings before merging your pull request](/en/code-security/code-quality/tutorials/fix-findings-in-prs).\n* Provide feedback on GitHub Code Quality in the [community discussion](https://github.com/orgs/community/discussions/177488)."}