fisharebest/webtrees

View on GitHub

Showing 1,726 of 2,403 total issues

Function drawPieChart has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  drawPieChart (elementId, data, options) {
    // Default chart options
    const defaults = {
      title: '',
      height: '100%',
Severity: Minor
Found in resources/js/statistics.js - About 1 hr to fix

    Function calendarWidget has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      webtrees.calendarWidget = function (dateDivId, dateFieldId) {
        let dateDiv = document.getElementById(dateDivId);
        let dateField = document.getElementById(dateFieldId);
    
        if (dateDiv.style.visibility === 'visible') {
    Severity: Minor
    Found in resources/js/webtrees.js - About 1 hr to fix

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

          public function summary(): string
          {
              $attributes = [];
              $target     = $this->target();
              if ($target instanceof GedcomRecord) {
      Severity: Minor
      Found in app/Fact.php - About 1 hr to fix

        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/AbstractIndividualListModule.php - About 1 hr to fix

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

              public function getAdminAction(ServerRequestInterface $request): ResponseInterface
              {
                  $this->layout = 'layouts/administration';
          
                  // This module can't run without a tree
          Severity: Minor
          Found in app/Module/StoriesModule.php - About 1 hr to fix

            Method handle has 30 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();
                    $xref = Validator::attributes($request)->isXref()->string('xref');
            Severity: Minor
            Found in app/Module/CompactTreeChartModule.php - About 1 hr to fix

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

                  public function getAdminEditAction(ServerRequestInterface $request): ResponseInterface
                  {
                      $this->layout = 'layouts/administration';
              
                      $tree     = Validator::attributes($request)->tree();
              Severity: Minor
              Found in app/Module/StoriesModule.php - About 1 hr to fix

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

                    public function make(string $name): EncodingInterface
                    {
                        switch ($name) {
                            case UTF8::NAME:
                                return new UTF8();
                Severity: Minor
                Found in app/Factories/EncodingFactory.php - About 1 hr to fix

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

                      public function handle(ServerRequestInterface $request): ResponseInterface
                      {
                          $tree   = Validator::attributes($request)->tree();
                          $xref   = Validator::attributes($request)->isXref()->string('xref');
                          $sex    = Validator::attributes($request)->string('sex');
                  Severity: Minor
                  Found in app/Http/RequestHandlers/AddSpouseToFamilyPage.php - About 1 hr to fix

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

                        public function handle(ServerRequestInterface $request): ResponseInterface
                        {
                            $tree   = Validator::attributes($request)->tree();
                            $xref   = Validator::attributes($request)->isXref()->string('xref');
                            $slug   = Validator::attributes($request)->string('slug', '');
                    Severity: Minor
                    Found in app/Http/RequestHandlers/NotePage.php - About 1 hr to fix

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

                          public function handle(ServerRequestInterface $request): ResponseInterface
                          {
                              $data_filesystem = Registry::filesystem()->data();
                      
                              $gedcom_files = $this->admin_service->gedcomFiles($data_filesystem);
                      Severity: Minor
                      Found in app/Http/RequestHandlers/SynchronizeTrees.php - About 1 hr to fix

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

                            public function handle(ServerRequestInterface $request): ResponseInterface
                            {
                                $tree   = Validator::attributes($request)->tree();
                                $xref   = Validator::attributes($request)->isXref()->string('xref');
                                $slug   = Validator::attributes($request)->string('slug', '');
                        Severity: Minor
                        Found in app/Http/RequestHandlers/SharedNotePage.php - About 1 hr to fix

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

                              public function pendingChanges(Tree $tree, int $n): array
                              {
                                  $xrefs = $this->pendingXrefs($tree);
                          
                                  $rows = DB::table('change')
                          Severity: Minor
                          Found in app/Services/PendingChangesService.php - About 1 hr to fix

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

                                public function columns(): array
                                {
                                    return [
                                        new CensusColumnSexMF($this, 'Sex', 'Sex'),
                                        new CensusColumnNull($this, 'Num', 'Number of people in the family'),
                            Severity: Minor
                            Found in app/Census/CensusOfRhodeIsland1905.php - About 1 hr to fix

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

                                  public function chartSex(
                                      int $tot_m,
                                      int $tot_f,
                                      int $tot_u,
                                      string|null $color_female = null,
                              Severity: Minor
                              Found in app/Statistics/Google/ChartSex.php - About 1 hr to fix

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

                                    public function columns(): array
                                    {
                                        return [
                                            new CensusColumnFullName($this, 'Name', 'Name'),
                                            new CensusColumnRelationToHeadEnglish($this, 'Relation', 'Relationship of each person to the head of the family'),
                                Severity: Minor
                                Found in app/Census/CensusOfUnitedStates1930.php - About 1 hr to fix

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

                                      private function commonSurnamesQuery(
                                          string $type,
                                          bool $show_tot,
                                          int $threshold,
                                          int $number_of_surnames,
                                  Severity: Minor
                                  Found in app/Statistics/Repository/IndividualRepository.php - About 1 hr to fix

                                    Method allAncestors has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        private function allAncestors(string $xref1, string $xref2, int $tree_id): array
                                        {
                                            $ancestors = [
                                                $xref1,
                                                $xref2,
                                    Severity: Minor
                                    Found in app/Module/RelationshipsChartModule.php - About 1 hr to fix

                                      Method process has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
                                          {
                                              if ($this->upgrade_service->isUpgradeAvailable()) {
                                                  $latest_version       = $this->upgrade_service->latestVersion();
                                                  $latest_version_email = Site::getPreference('LATEST_WT_VERSION_EMAIL');
                                      Severity: Minor
                                      Found in app/Module/CheckForNewVersion.php - About 1 hr to fix

                                        Method alphabet has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            public function alphabet(): array
                                            {
                                                return [
                                                    'A',
                                                    'B',
                                        Severity: Minor
                                        Found in app/Module/LanguageSpanish.php - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language