fisharebest/webtrees

View on GitHub

Showing 1,726 of 2,403 total issues

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

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

    public function individualBoxMenuFamilyLinks(Individual $individual): array
    {
        $menus = [];

        foreach ($individual->spouseFamilies() as $family) {
Severity: Minor
Found in app/Module/ModuleThemeTrait.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 layoutIndividuals has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    private function layoutIndividuals(array $individuals): array
    {
        $color_generators = [
            'M' => new ColorGenerator(240, self::SATURATION, self::LIGHTNESS, self::ALPHA, self::RANGE * -1),
            'F' => new ColorGenerator(000, self::SATURATION, self::LIGHTNESS, self::ALPHA, self::RANGE),
Severity: Minor
Found in app/Module/LifespansChartModule.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 metaDescription has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    private function metaDescription(Individual $individual): string
    {
        $meta_facts = [];

        $birth_date  = $individual->getBirthDate();
Severity: Minor
Found in app/Http/RequestHandlers/IndividualPage.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 handle has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function handle(ServerRequestInterface $request): ResponseInterface
    {
        $tree               = Validator::attributes($request)->tree();
        $keep_media         = Validator::parsedBody($request)->boolean('keep_media', false);
        $word_wrapped_notes = Validator::parsedBody($request)->boolean('WORD_WRAPPED_NOTES', false);
Severity: Minor
Found in app/Http/RequestHandlers/ImportGedcomAction.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 createHeader has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function createHeader(Tree $tree, string $encoding, bool $include_sub): string
    {
        // Force a ".ged" suffix
        $filename = $tree->name();

Severity: Minor
Found in app/Services/GedcomExportService.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 calendarMonthsInYear has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function calendarMonthsInYear(string $calendar, int $year): array
    {
        $date          = new Date($calendar . ' ' . $year);
        $calendar_date = $date->minimumDate();
        $month_numbers = range(1, $calendar_date->monthsInYear());
Severity: Minor
Found in app/Services/CalendarService.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 labelValue has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function labelValue(string $value, Tree $tree): string
    {
        $id       = Registry::idFactory()->id();
        $expanded = $tree->getPreference('EXPAND_NOTES') === '1';

Severity: Minor
Found in app/Elements/NoteStructure.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 boundingRectangle has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function boundingRectangle(): array
    {
        if ($this->id() === null) {
            return [[-180.0, -90.0], [180.0, 90.0]];
        }
Severity: Minor
Found in app/PlaceLocation.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 getEventCount has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    private function getEventCount(array $events): int
    {
        $query = DB::table('dates')
            ->where('d_file', '=', $this->tree->id());

Severity: Minor
Found in app/Statistics/Repository/EventRepository.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 inputStartHandler has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    protected function inputStartHandler(array $attrs): void
    {
        $this->text  = '';
        $this->input = [
            'name'    => $attrs['name'] ?? '',
Severity: Minor
Found in app/Report/ReportParserSetup.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 lastChangeTimestamp has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function lastChangeTimestamp(): TimestampInterface
    {
        $chan = $this->facts(['CHAN'])->first();

        if ($chan instanceof Fact) {
Severity: Minor
Found in app/GedcomRecord.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

Method myPlot has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

        string $chart_title,
        array $x_axis,
        string $x_axis_title,
        array $ydata,
        string $y_axis_title,
Severity: Major
Found in app/Module/StatisticsChartModule.php - About 50 mins to fix

    Method lineError has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            Tree $tree,
            string $type,
            string $xref,
            int $line_number,
            string $line,
    Severity: Major
    Found in app/Http/RequestHandlers/CheckTree.php - About 50 mins to fix

      Method createImageFromObject has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              MediaFile $media_file,
              float $x,
              float $y,
              float $w,
              float $h,
      Severity: Major
      Found in app/Report/PdfRenderer.php - About 50 mins to fix

        Method createImageFromObject has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                MediaFile $media_file,
                float $x,
                float $y,
                float $w,
                float $h,
        Severity: Major
        Found in app/Report/AbstractRenderer.php - About 50 mins to fix

          Method createImage has 7 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              public function createImage(string $file, float $x, float $y, float $w, float $h, string $align, string $ln): ReportBaseImage
          Severity: Major
          Found in app/Report/PdfRenderer.php - About 50 mins to fix

            Method createImage has 7 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                public function createImage(string $file, float $x, float $y, float $w, float $h, string $align, string $ln): ReportBaseImage
            Severity: Major
            Found in app/Report/HtmlRenderer.php - About 50 mins to fix

              Method createImage has 7 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  abstract public function createImage(string $file, float $x, float $y, float $w, float $h, string $align, string $ln): ReportBaseImage;
              Severity: Major
              Found in app/Report/AbstractRenderer.php - About 50 mins to fix
                Severity
                Category
                Status
                Source
                Language