fisharebest/webtrees

View on GitHub
app/Module/IndividualListModule.php

Summary

Maintainability
F
5 days
Test Coverage

Function handle has a Cognitive Complexity of 124 (exceeds 5 allowed). Consider refactoring.
Open

    public function handle(ServerRequestInterface $request): ResponseInterface
    {
        $tree = Validator::attributes($request)->tree();
        $user = Validator::attributes($request)->user();

Severity: Minor
Found in app/Module/IndividualListModule.php - About 2 days 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

Method handle has 296 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function handle(ServerRequestInterface $request): ResponseInterface
    {
        $tree = Validator::attributes($request)->tree();
        $user = Validator::attributes($request)->user();

Severity: Major
Found in app/Module/IndividualListModule.php - About 1 day to fix

    File IndividualListModule.php has 551 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    /**
     * webtrees: online genealogy
     * Copyright (C) 2023 webtrees development team
    Severity: Major
    Found in app/Module/IndividualListModule.php - About 1 day to fix

      Function individuals has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function individuals(Tree $tree, array $surns_to_show, string $galpha, bool $marnm, bool $fams): Collection
          {
              $query = DB::table('individuals')
                  ->join('name', static function (JoinClause $join): void {
                      $join
      Severity: Minor
      Found in app/Module/IndividualListModule.php - About 1 hr 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

      Method individuals has 30 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function individuals(Tree $tree, array $surns_to_show, string $galpha, bool $marnm, bool $fams): Collection
          {
              $query = DB::table('individuals')
                  ->join('name', static function (JoinClause $join): void {
                      $join
      Severity: Minor
      Found in app/Module/IndividualListModule.php - About 1 hr to fix

        Method individuals has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            protected function individuals(Tree $tree, array $surns_to_show, string $galpha, bool $marnm, bool $fams): Collection
        Severity: Minor
        Found in app/Module/IndividualListModule.php - About 35 mins to fix

          There are no issues that match your filters.

          Category
          Status