fisharebest/webtrees

View on GitHub

Showing 1,726 of 2,403 total issues

Method chartNoChildrenFamilies has 45 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function chartNoChildrenFamilies(
        int $no_child_fam,
        int $year1 = -1,
        int $year2 = -1
    ): string {
Severity: Minor
Found in app/Statistics/Google/ChartNoChildrenFamilies.php - About 1 hr to fix

    Method render has 45 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function render($renderer): void
        {
            // Set up the style
            if ($renderer->getCurrentStyle() !== $this->styleName) {
                $renderer->setCurrentStyle($this->styleName);
    Severity: Minor
    Found in app/Report/ReportPdfText.php - About 1 hr to fix

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

          public function alphabet(): array
          {
              return [
                  'A',
                  UTF8::LATIN_CAPITAL_LETTER_A_WITH_ACUTE,
      Severity: Minor
      Found in app/Module/LanguageCzech.php - About 1 hr to fix

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

            public function changesQuery(array $params): Builder
            {
                $tree     = $params['tree'];
                $from     = $params['from'] ?? '';
                $to       = $params['to'] ?? '';
        Severity: Minor
        Found in app/Services/PendingChangesService.php - About 1 hr to fix

          Method handle has 44 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();
                  $report = Validator::attributes($request)->string('report');
          Severity: Minor
          Found in app/Http/RequestHandlers/ReportGenerate.php - About 1 hr to fix

            Method handle has 44 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/LinkChildToFamilyAction.php - About 1 hr to fix

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

                  protected function getPersonNameStartHandler(array $attrs): void
                  {
                      $id    = '';
                      $match = [];
                      if (empty($attrs['id'])) {
              Severity: Minor
              Found in app/Report/ReportParserGenerate.php - About 1 hr to fix

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

                    public function previousLink(Individual $individual, string $style, int $generations): string
                    {
                        $icon = view('icons/arrow-' . self::MIRROR_STYLE[$style]);
                
                        $siblings = [];
                Severity: Minor
                Found in app/Module/PedigreeChartModule.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

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

                    public function handle(ServerRequestInterface $request): ResponseInterface
                    {
                        $tree  = Validator::attributes($request)->tree();
                        $user  = Validator::attributes($request)->user();
                        $xrefs = Validator::queryParams($request)->string('xrefs', '');
                Severity: Minor
                Found in app/Module/LifespansChartModule.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

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

                    public function handle(ServerRequestInterface $request): ResponseInterface
                    {
                        $data_filesystem = Registry::filesystem()->data();
                
                        $files = Validator::queryParams($request)->isInArray(['local', 'external', 'unused'])->string('files');
                Severity: Minor
                Found in app/Http/RequestHandlers/ManageMediaData.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

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

                    public function __construct(array|int|AbstractCalendarDate $date)
                    {
                        // Construct from an integer (a julian day number)
                        if (is_int($date)) {
                            $this->minimum_julian_day = $date;
                Severity: Minor
                Found in app/Date/AbstractCalendarDate.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

                Function handle has a Cognitive Complexity of 14 (exceeds 5 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

                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 handle has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function handle(ServerRequestInterface $request): ResponseInterface
                    {
                        $tree  = Validator::attributes($request)->tree();
                        $xref1 = Validator::parsedBody($request)->isXref()->string('xref1');
                        $xref2 = Validator::parsedBody($request)->isXref()->string('xref2');
                Severity: Minor
                Found in app/Http/RequestHandlers/MergeFactsAction.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 createCell has 14 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    public function createCell(float $width, float $height, string $border, string $align, string $bgcolor, string $style, int $ln, float $top, float $left, bool $fill, int $stretch, string $bocolor, string $tcolor, bool $reseth): ReportBaseCell
                Severity: Major
                Found in app/Report/PdfRenderer.php - About 1 hr to fix

                  Method createCell has 14 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      public function createCell(float $width, float $height, string $border, string $align, string $bgcolor, string $style, int $ln, float $top, float $left, bool $fill, int $stretch, string $bocolor, string $tcolor, bool $reseth): ReportBaseCell
                  Severity: Major
                  Found in app/Report/HtmlRenderer.php - About 1 hr to fix

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

                            float $width,
                            float $height,
                            string $border,
                            string $align,
                            string $bgcolor,
                    Severity: Major
                    Found in app/Report/ReportBaseCell.php - About 1 hr to fix

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

                          public static function textScript(string $string): string
                          {
                              $string = strip_tags($string); // otherwise HTML tags show up as latin
                              $string = html_entity_decode($string, ENT_QUOTES, 'UTF-8'); // otherwise HTML entities show up as latin
                              $string = str_replace([
                      Severity: Minor
                      Found in app/I18N.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 createCell has 14 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                              float $width,
                              float $height,
                              string $border,
                              string $align,
                              string $bgcolor,
                      Severity: Major
                      Found in app/Report/AbstractRenderer.php - About 1 hr to fix

                        Function expandBox has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        TreeViewHandler.prototype.expandBox = function (box, event) {
                          var t = $(event.target);
                          if (t.hasClass('tv_link')) {
                            return false;
                          }
                        Severity: Minor
                        Found in resources/js/treeview.js - About 1 hr to fix

                          Method handle has 43 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/FanChartModule.php - About 1 hr to fix
                            Severity
                            Category
                            Status
                            Source
                            Language