fisharebest/webtrees

View on GitHub

Showing 1,726 of 2,403 total issues

Method doLogin has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function doLogin(string $username, #[\SensitiveParameter] string $password): void
    {
        if ($_COOKIE === []) {
            Log::addAuthenticationLog('Login failed (no session cookies): ' . $username);
            throw new Exception(I18N::translate('You cannot sign in because your browser does not accept cookies.'));
Severity: Minor
Found in app/Http/RequestHandlers/LoginAction.php - About 1 hr to fix

    Method handle has 27 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');
            $individual = Registry::individualFactory()->make($xref, $tree);
    Severity: Minor
    Found in app/Http/RequestHandlers/LinkSpouseToIndividualPage.php - About 1 hr to fix

      Method handle has 27 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');
              $record         = Registry::gedcomRecordFactory()->make($xref, $tree);
      Severity: Minor
      Found in app/Http/RequestHandlers/EditRecordPage.php - About 1 hr to fix

        Method spouseFacts has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private function spouseFacts(Individual $individual, Individual $spouse, Date $min_date, Date $max_date): Collection
            {
                $SHOW_RELATIVES_EVENTS = $individual->tree()->getPreference('SHOW_RELATIVES_EVENTS');
        
                $death_of_a_spouse = [
        Severity: Minor
        Found in app/Services/IndividualFactsService.php - About 1 hr to fix

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

              public function handle(ServerRequestInterface $request): ResponseInterface
              {
                  $recipients = $this->message_service->recipientTypes();
          
                  $user    = Validator::attributes($request)->user();
          Severity: Minor
          Found in app/Http/RequestHandlers/BroadcastAction.php - About 1 hr to fix

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

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

              Method values has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function values(string $sex = 'U'): array
                  {
                      $values = [
                          'M' => [
                              ''                  => '',
              Severity: Minor
              Found in app/Elements/PedigreeLinkageType.php - About 1 hr to fix

                Method values has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function values(): array
                    {
                        $values = [
                            ''     => '',
                            'ADOP' => Registry::elementFactory()->make('INDI:ADOP')->label(),
                Severity: Minor
                Found in app/Elements/IndividualNonEvent.php - About 1 hr to fix

                  Method canShowRecord has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      private function canShowRecord(int $access_level): bool
                      {
                          // This setting would better be called "$ENABLE_PRIVACY"
                          if (!$this->tree->getPreference('HIDE_LIVE_PEOPLE')) {
                              return true;
                  Severity: Minor
                  Found in app/GedcomRecord.php - About 1 hr to fix

                    Method canShow has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function canShow(int|null $access_level = null): bool
                        {
                            $access_level ??= Auth::accessLevel($this->record->tree());
                    
                            // Does this record have an explicit restriction notice?
                    Severity: Minor
                    Found in app/Fact.php - About 1 hr to fix

                      Function compact has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      TreeViewHandler.prototype.compact = function () {
                        var tv = this;
                        var b = $('#tvbCompact', tv.toolbox);
                        tv.setLoading();
                        if (tv.auto_box_width) {
                      Severity: Minor
                      Found in resources/js/treeview.js - About 1 hr to fix

                        Function reformatLatLong has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          function reformatLatLong (field, pos, neg) {
                            // valid LATI or LONG according to Gedcom standard
                            // pos (+) : N or E
                            // neg (-) : S or W
                            let txt = field.value.toUpperCase();
                        Severity: Minor
                        Found in resources/js/webtrees.js - About 1 hr to fix

                          Method historicEventsAll has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function historicEventsAll(): Collection
                              {
                                  switch (I18N::languageTag()) {
                                      case 'en-AU':
                                      case 'en-GB':
                          Severity: Minor
                          Found in app/Module/BritishSocialHistory.php - About 1 hr to fix

                            Method leafletJsTileLayers has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function leafletJsTileLayers(): array
                                {
                                    return [
                                        (object) [
                                            'attribution' => 'Tiles ©Esri — Source: Esri, DeLorme, NAVTEQ, USGS, Intermap, iPC, NRCAN, Esri Japan, METI, Esri China (Hong Kong), Esri (Thailand), TomTom, 2012',
                            Severity: Minor
                            Found in app/Module/EsriMaps.php - About 1 hr to fix

                              Method tags has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function tags(): array
                                  {
                                      return [
                                          'FAM:CHAN:_PGVU'        => new WebtreesUser(I18N::translate('Author of last change')),
                                          'FAM:COMM'              => new CustomElement(I18N::translate('Comment')),
                              Severity: Minor
                              Found in app/CustomTags/PhpGedView.php - About 1 hr to fix

                                Method tags has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public function tags(): array
                                    {
                                        return [
                                            'FAM:*:SOUR:_TMPLT'              => new EmptyElement(I18N::translate('Template')),
                                            'FAM:*:SOUR:_TMPLT:FIELD'        => /* I18N: Data entry field */ new EmptyElement(I18N::translate('Field')),
                                Severity: Minor
                                Found in app/CustomTags/RootsMagic.php - About 1 hr to fix

                                  Method associateFacts has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      public function associateFacts(Individual $individual): Collection
                                      {
                                          $facts = [];
                                  
                                          $asso1 = $this->linked_record_service->linkedIndividuals($individual, 'ASSO');
                                  Severity: Minor
                                  Found in app/Services/IndividualFactsService.php - About 1 hr to fix

                                    Method handle has 26 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');
                                            $individual = Registry::individualFactory()->make($xref, $tree);
                                    Severity: Minor
                                    Found in app/Http/RequestHandlers/AddSpouseToIndividualPage.php - About 1 hr to fix

                                      Method databaseDriverErrors has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          private function databaseDriverErrors(string $driver): Collection
                                          {
                                              switch ($driver) {
                                                  case DB::MYSQL:
                                                      return Collection::make([
                                      Severity: Minor
                                      Found in app/Services/ServerCheckService.php - About 1 hr to fix

                                        Method handle has 26 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');
                                                $fact_id = Validator::attributes($request)->string('fact_id');
                                        Severity: Minor
                                        Found in app/Http/RequestHandlers/EditMediaFileModal.php - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language