fisharebest/webtrees

View on GitHub

Showing 1,725 of 2,402 total issues

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

    public function chartIndisWithSources(
        int $tot_indi,
        int $tot_indi_source,
        string|null $color_from = null,
        string|null $color_to = null
Severity: Minor
Found in app/Statistics/Google/ChartIndividualWithSources.php - About 1 hr to fix

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

        public function chartCommonGiven(
            int $tot_indi,
            array $given,
            string|null $color_from = null,
            string|null $color_to = null
    Severity: Minor
    Found in app/Statistics/Google/ChartCommonGiven.php - About 1 hr to fix

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

          public function chartFamsWithSources(
              int $tot_fam,
              int $tot_fam_source,
              string|null $color_from = null,
              string|null $color_to = null
      Severity: Minor
      Found in app/Statistics/Google/ChartFamilyWithSources.php - About 1 hr to fix

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

            public function columns(): array
            {
                return [
                    new CensusColumnGivenNameInitial($this, 'Name', 'Christian name in full, and initial of middle name'),
                    new CensusColumnSurname($this, 'Surname', 'Surname'),
        Severity: Minor
        Found in app/Census/CensusOfUnitedStates1890.php - About 1 hr to fix

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

              public function chartMortality(
                  int $tot_l,
                  int $tot_d,
                  string|null $color_living = null,
                  string|null $color_dead = null
          Severity: Minor
          Found in app/Statistics/Google/ChartMortality.php - About 1 hr to fix

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

                public function chartCommonSurnames(
                    int $tot_indi,
                    array $all_surnames,
                    string|null $color_from = null,
                    string|null $color_to = null
            Severity: Minor
            Found in app/Statistics/Google/ChartCommonSurname.php - About 1 hr to fix

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

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

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

                    public function updateRecord(string $gedcom, bool $update_chan): void
                    {
                        // Not all record types allow a CHAN event.
                        $update_chan = $update_chan && in_array(static::RECORD_TYPE, Gedcom::RECORDS_WITH_CHAN, true);
                
                
                Severity: Minor
                Found in app/GedcomRecord.php - About 1 hr to fix

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

                      public static function getSubRecord(int $level, string $tag, string $gedrec, int $num = 1): string
                      {
                          if ($gedrec === '') {
                              return '';
                          }
                  Severity: Minor
                  Found in app/Report/ReportParserGenerate.php - About 1 hr to fix

                    Method getDescendantsHtml has 8 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        private function getDescendantsHtml(Tree $tree, array $individuals, array $ancestors, string $surname, bool $soundex_dm, bool $soundex_std, Individual $individual, Family|null $parents = null): string
                    Severity: Major
                    Found in app/Module/BranchesListModule.php - About 1 hr to fix

                      Method export has 8 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                              Tree $tree,
                              bool $sort_by_xref = false,
                              string $encoding = UTF8::NAME,
                              int $access_level = Auth::PRIV_HIDE,
                              string $line_endings = 'CRLF',
                      Severity: Major
                      Found in app/Services/GedcomExportService.php - About 1 hr to fix

                        Consider simplifying this complex logical expression.
                        Open

                                    if (str_starts_with($field_name, 'INDI:NAME:')) {
                                        switch ($field_name) {
                                            case 'INDI:NAME:GIVN':
                                                switch ($modifiers[$field_name]) {
                                                    case 'EXACT':
                        Severity: Major
                        Found in app/Services/SearchService.php - About 1 hr to fix

                          Method __construct has 8 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                                  AdminService $admin_service,
                                  HousekeepingService $housekeeping_service,
                                  MessageService $message_service,
                                  ModuleService $module_service,
                                  ServerCheckService $server_check_service,
                          Severity: Major
                          Found in app/Http/RequestHandlers/ControlPanel.php - About 1 hr to fix

                            Method downloadResponse has 8 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                    Tree $tree,
                                    bool $sort_by_xref,
                                    string $encoding,
                                    string $privacy,
                                    string $line_endings,
                            Severity: Major
                            Found in app/Services/GedcomExportService.php - About 1 hr to fix

                              Consider simplifying this complex logical expression.
                              Open

                                          if ($one && !in_array($fam->family, $dist, true)) {
                                              if ($family !== null && $child1 !== null && $child2 !== null && $child1->canShow() && $child2->canShow()) {
                                                  $top10[] = [
                                                      'child1' => $child1,
                                                      'child2' => $child2,
                              Severity: Major
                              Found in app/Statistics/Repository/FamilyRepository.php - About 1 hr to fix

                                Function tryContinue has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    public function tryContinue(Cursor $cursor, BlockContinueParserInterface $activeBlockParser): BlockContinue|null
                                    {
                                        $line = $cursor->getLine();
                                
                                        if ($line === CensusTableExtension::CA_SUFFIX) {
                                Severity: Minor
                                Found in app/CommonMark/CensusTableContinueParser.php - About 55 mins 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

                                Function name has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    public function name(): string
                                    {
                                        $items  = [$this->label()];
                                        $target = $this->target();
                                
                                
                                Severity: Minor
                                Found in app/Fact.php - About 55 mins 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

                                Function isXref has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    public function isXref(): self
                                    {
                                        $this->rules[] = static function ($value) {
                                            if (is_string($value) && preg_match('/^' . Gedcom::REGEX_XREF . '$/', $value) === 1) {
                                                return $value;
                                Severity: Minor
                                Found in app/Validator.php - About 55 mins 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

                                Function getBlock has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    public function getBlock(Tree $tree, int $block_id, string $context, array $config = []): string
                                    {
                                        $calendar_service = new CalendarService();
                                
                                        $default_events = implode(',', self::DEFAULT_EVENTS);
                                Severity: Minor
                                Found in app/Module/OnThisDayModule.php - About 55 mins 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

                                Function mapData has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    protected function mapData(Place $place): array
                                    {
                                        $children  = $place->getChildPlaces();
                                        $features  = [];
                                        $sidebar   = '';
                                Severity: Minor
                                Found in app/Module/PlaceHierarchyListModule.php - About 55 mins 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

                                Severity
                                Category
                                Status
                                Source
                                Language