jon48/webtrees-lib

View on GitHub

Showing 96 of 758 total issues

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

    public function handle(ServerRequestInterface $request): ResponseInterface
    {
        if ($this->module === null) {
            throw new HttpNotFoundException(I18N::translate('The attached module could not be found.'));
        }
Severity: Minor
Found in app/Module/Sosa/Http/RequestHandlers/MissingAncestorsList.php - About 1 hr to fix

    Function upgrade has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

        public function upgrade(): void
        {
            if (!DB::schema()->hasTable('maj_geodispersion')) {
                return;
            }
    Severity: Minor
    Found in app/Module/GeoDispersion/Schema/Migration2.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 buildLineages has 42 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function buildLineages(): ?Collection
        {
            $indis = $this->patrolineage_module->individuals(
                $this->tree,
                $this->surname,
    Severity: Minor
    Found in app/Module/PatronymicLineage/Model/LineageBuilder.php - About 1 hr to fix

      Method generationDepthStatsAtGeneration has 42 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function generationDepthStatsAtGeneration(int $gen): Collection
          {
              if (!$this->isPdoSupported()) {
                  return collect();
              }
      Severity: Minor
      Found in app/Module/Sosa/Services/SosaStatisticsService.php - About 1 hr to fix

        Method individualColumns has 41 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function individualColumns(iterable $records): array
            {
                $records = collect($records);
                return [
                    'issourced' => [
        Severity: Minor
        Found in app/Module/IsSourced/Hooks/IsSourcedStatusColumnsHook.php - About 1 hr to fix

          Method sosaMissingColumns has 41 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function sosaMissingColumns(iterable $records): array
              {
                  $records = collect($records);
                  return [
                      'issourced' => [
          Severity: Minor
          Found in app/Module/IsSourced/Hooks/IsSourcedStatusColumnsHook.php - About 1 hr to fix

            Method certificateFileResponse has 40 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function certificateFileResponse(
                    Certificate $certificate,
                    bool $add_watermark = false,
                    Watermark $watermark = null
                ): ResponseInterface {
            Severity: Minor
            Found in app/Module/Certificates/Factories/CertificateImageFactory.php - About 1 hr to fix

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

                  public function handle(ServerRequestInterface $request): ResponseInterface
                  {
                      $tree = Validator::attributes($request)->tree();
              
                      if ($this->module === null) {
              Severity: Minor
              Found in app/Module/Certificates/Http/RequestHandlers/AdminConfigAction.php - About 1 hr to fix

                Method statisticsByGenerations has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private function statisticsByGenerations(SosaStatisticsService $sosa_stats_service): array
                    {
                        $stats_by_gen = $sosa_stats_service->statisticsByGenerations();
                
                        $generation_stats = array();
                Severity: Minor
                Found in app/Module/Sosa/Http/RequestHandlers/SosaStatistics.php - About 1 hr to fix

                  Method updateGeneralSettings has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      private function updateGeneralSettings(TaskSchedule $task_schedule, ServerRequestInterface $request): bool
                      {
                          if ($this->module === null) {
                              return false;
                          }
                  Severity: Minor
                  Found in app/Module/AdminTasks/Http/RequestHandlers/TaskEditAction.php - About 1 hr to fix

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

                        public function handle(ServerRequestInterface $request): ResponseInterface
                        {
                            $tree = Validator::attributes($request)->tree();
                    
                            if ($this->module === null) {

                      Method run has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function run(TaskSchedule $task_schedule, $force = false): void
                          {
                              /** @var TaskSchedule $task_schedule */
                              $task_schedule = DB::table('maj_admintasks')
                                  ->select()
                      Severity: Minor
                      Found in app/Module/AdminTasks/Services/TaskScheduleService.php - About 1 hr to fix

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

                            public function handle(ServerRequestInterface $request): ResponseInterface
                            {
                                if ($this->module === null) {
                                    throw new HttpNotFoundException(I18N::translate('The attached module could not be found.'));
                                }
                        Severity: Minor
                        Found in app/Module/Sosa/Http/RequestHandlers/SosaConfig.php - About 1 hr to fix

                          Function all has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public function all(bool $sync_available = false, bool $include_disabled = true): Collection
                              {
                                  $tasks_schedules = DB::table('maj_admintasks')
                                      ->select()
                                      ->get()
                          Severity: Minor
                          Found in app/Module/AdminTasks/Services/TaskScheduleService.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 handle has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function handle(ServerRequestInterface $request): ResponseInterface
                              {
                                  $tree = Validator::attributes($request)->tree();
                          
                                  if ($this->module === null) {

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

                                public function handle(ServerRequestInterface $request): ResponseInterface
                                {
                                    $this->layout = 'layouts/ajax';
                            
                                    if ($this->module === null) {
                            Severity: Minor
                            Found in app/Module/Sosa/Http/RequestHandlers/AncestorsListIndividual.php - About 1 hr to fix

                              Method convert has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function convert(GeoAnalysisResult $result): MapAdapterResult
                                  {
                                      $result = $result->copy();
                              
                                      $features = [];
                              Severity: Minor
                              Found in app/Module/GeoDispersion/Model/GeoAnalysisMapAdapter.php - About 1 hr to fix

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

                                    public function handle(ServerRequestInterface $request): ResponseInterface
                                    {
                                        if ($this->module === null) {
                                            FlashMessages::addMessage(
                                                I18N::translate('The attached module could not be found.'),
                                Severity: Minor
                                Found in app/Module/AdminTasks/Http/RequestHandlers/TaskStatusAction.php - About 1 hr to fix

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

                                      public function handle(ServerRequestInterface $request): ResponseInterface
                                      {
                                          $this->layout = 'layouts/ajax';
                                  
                                          if ($this->module === null) {
                                  Severity: Minor
                                  Found in app/Module/Sosa/Http/RequestHandlers/AncestorsListFamily.php - About 1 hr to fix

                                    Method upgrade has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        public function upgrade(): void
                                        {
                                            if (!DB::schema()->hasTable('maj_geodispersion')) {
                                                return;
                                            }
                                    Severity: Minor
                                    Found in app/Module/GeoDispersion/Schema/Migration2.php - About 1 hr to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language