fisharebest/webtrees

View on GitHub

Showing 677 of 2,403 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        if (preg_match('/#?(..)(..)(..)/', $this->tcolor, $match)) {
            $r = hexdec($match[1]);
            $g = hexdec($match[2]);
            $b = hexdec($match[3]);
            $renderer->tcpdf->setTextColor($r, $g, $b);
Severity: Major
Found in app/Report/ReportPdfCell.php and 1 other location - About 1 hr to fix
app/Report/ReportPdfText.php on lines 59..66

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 111.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    public function adoptive(): Relationship
    {
        $this->matchers[] = static fn (array $nodes): bool => $nodes[0]
            ->facts(['FAMC'], false, Auth::PRIV_HIDE)
            ->contains(fn (Fact $fact): bool => $fact->value() === '@' . $nodes[1]->xref() . '@' && $fact->attribute('PEDI') === PedigreeLinkageType::VALUE_ADOPTED);
Severity: Major
Found in app/Relationship.php and 1 other location - About 1 hr to fix
app/Relationship.php on lines 356..363

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 111.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        if (preg_match('/#?(..)(..)(..)/', $this->color, $match)) {
            $r = hexdec($match[1]);
            $g = hexdec($match[2]);
            $b = hexdec($match[3]);
            $renderer->tcpdf->setTextColor($r, $g, $b);
Severity: Major
Found in app/Report/ReportPdfText.php and 1 other location - About 1 hr to fix
app/Report/ReportPdfCell.php on lines 84..91

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 111.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 13 locations. Consider refactoring.
Open

<?php

/**
 * webtrees: online genealogy
 * Copyright (C) 2023 webtrees development team
Severity: Major
Found in app/Elements/CustomFamilyEvent.php and 12 other locations - About 1 hr to fix
app/Elements/Adoption.php on lines 1..46
app/Elements/Annulment.php on lines 1..46
app/Elements/Birth.php on lines 1..46
app/Elements/Divorce.php on lines 1..46
app/Elements/DivorceFiled.php on lines 1..46
app/Elements/Engagement.php on lines 1..46
app/Elements/FamilyCensus.php on lines 1..46
app/Elements/Marriage.php on lines 1..46
app/Elements/MarriageBanns.php on lines 1..46
app/Elements/MarriageContract.php on lines 1..46
app/Elements/MarriageLicence.php on lines 1..46
app/Elements/MarriageSettlement.php on lines 1..46

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 110.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 13 locations. Consider refactoring.
Open

<?php

/**
 * webtrees: online genealogy
 * Copyright (C) 2023 webtrees development team
Severity: Major
Found in app/Elements/Engagement.php and 12 other locations - About 1 hr to fix
app/Elements/Adoption.php on lines 1..46
app/Elements/Annulment.php on lines 1..46
app/Elements/Birth.php on lines 1..46
app/Elements/CustomFamilyEvent.php on lines 1..46
app/Elements/Divorce.php on lines 1..46
app/Elements/DivorceFiled.php on lines 1..46
app/Elements/FamilyCensus.php on lines 1..46
app/Elements/Marriage.php on lines 1..46
app/Elements/MarriageBanns.php on lines 1..46
app/Elements/MarriageContract.php on lines 1..46
app/Elements/MarriageLicence.php on lines 1..46
app/Elements/MarriageSettlement.php on lines 1..46

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 110.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 13 locations. Consider refactoring.
Open

<?php

/**
 * webtrees: online genealogy
 * Copyright (C) 2023 webtrees development team
Severity: Major
Found in app/Elements/FamilyCensus.php and 12 other locations - About 1 hr to fix
app/Elements/Adoption.php on lines 1..46
app/Elements/Annulment.php on lines 1..46
app/Elements/Birth.php on lines 1..46
app/Elements/CustomFamilyEvent.php on lines 1..46
app/Elements/Divorce.php on lines 1..46
app/Elements/DivorceFiled.php on lines 1..46
app/Elements/Engagement.php on lines 1..46
app/Elements/Marriage.php on lines 1..46
app/Elements/MarriageBanns.php on lines 1..46
app/Elements/MarriageContract.php on lines 1..46
app/Elements/MarriageLicence.php on lines 1..46
app/Elements/MarriageSettlement.php on lines 1..46

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 110.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 13 locations. Consider refactoring.
Open

<?php

/**
 * webtrees: online genealogy
 * Copyright (C) 2023 webtrees development team
Severity: Major
Found in app/Elements/MarriageContract.php and 12 other locations - About 1 hr to fix
app/Elements/Adoption.php on lines 1..46
app/Elements/Annulment.php on lines 1..46
app/Elements/Birth.php on lines 1..46
app/Elements/CustomFamilyEvent.php on lines 1..46
app/Elements/Divorce.php on lines 1..46
app/Elements/DivorceFiled.php on lines 1..46
app/Elements/Engagement.php on lines 1..46
app/Elements/FamilyCensus.php on lines 1..46
app/Elements/Marriage.php on lines 1..46
app/Elements/MarriageBanns.php on lines 1..46
app/Elements/MarriageLicence.php on lines 1..46
app/Elements/MarriageSettlement.php on lines 1..46

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 110.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 13 locations. Consider refactoring.
Open

<?php

/**
 * webtrees: online genealogy
 * Copyright (C) 2023 webtrees development team
Severity: Major
Found in app/Elements/Marriage.php and 12 other locations - About 1 hr to fix
app/Elements/Adoption.php on lines 1..46
app/Elements/Annulment.php on lines 1..46
app/Elements/Birth.php on lines 1..46
app/Elements/CustomFamilyEvent.php on lines 1..46
app/Elements/Divorce.php on lines 1..46
app/Elements/DivorceFiled.php on lines 1..46
app/Elements/Engagement.php on lines 1..46
app/Elements/FamilyCensus.php on lines 1..46
app/Elements/MarriageBanns.php on lines 1..46
app/Elements/MarriageContract.php on lines 1..46
app/Elements/MarriageLicence.php on lines 1..46
app/Elements/MarriageSettlement.php on lines 1..46

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 110.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

    public function postAddNoteAction(ServerRequestInterface $request): ResponseInterface
    {
        $tree = Validator::attributes($request)->tree();
        $xref = Validator::queryParams($request)->isXref()->string('xref');
        $note = Registry::noteFactory()->make($xref, $tree);
Severity: Major
Found in app/Module/ClippingsCartModule.php and 3 other locations - About 1 hr to fix
app/Module/ClippingsCartModule.php on lines 567..577
app/Module/ClippingsCartModule.php on lines 601..611
app/Module/ClippingsCartModule.php on lines 753..763

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 110.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 13 locations. Consider refactoring.
Open

<?php

/**
 * webtrees: online genealogy
 * Copyright (C) 2023 webtrees development team
Severity: Major
Found in app/Elements/Annulment.php and 12 other locations - About 1 hr to fix
app/Elements/Adoption.php on lines 1..46
app/Elements/Birth.php on lines 1..46
app/Elements/CustomFamilyEvent.php on lines 1..46
app/Elements/Divorce.php on lines 1..46
app/Elements/DivorceFiled.php on lines 1..46
app/Elements/Engagement.php on lines 1..46
app/Elements/FamilyCensus.php on lines 1..46
app/Elements/Marriage.php on lines 1..46
app/Elements/MarriageBanns.php on lines 1..46
app/Elements/MarriageContract.php on lines 1..46
app/Elements/MarriageLicence.php on lines 1..46
app/Elements/MarriageSettlement.php on lines 1..46

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 110.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 13 locations. Consider refactoring.
Open

<?php

/**
 * webtrees: online genealogy
 * Copyright (C) 2023 webtrees development team
Severity: Major
Found in app/Elements/Adoption.php and 12 other locations - About 1 hr to fix
app/Elements/Annulment.php on lines 1..46
app/Elements/Birth.php on lines 1..46
app/Elements/CustomFamilyEvent.php on lines 1..46
app/Elements/Divorce.php on lines 1..46
app/Elements/DivorceFiled.php on lines 1..46
app/Elements/Engagement.php on lines 1..46
app/Elements/FamilyCensus.php on lines 1..46
app/Elements/Marriage.php on lines 1..46
app/Elements/MarriageBanns.php on lines 1..46
app/Elements/MarriageContract.php on lines 1..46
app/Elements/MarriageLicence.php on lines 1..46
app/Elements/MarriageSettlement.php on lines 1..46

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 110.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

    public function postAddSubmitterAction(ServerRequestInterface $request): ResponseInterface
    {
        $tree      = Validator::attributes($request)->tree();
        $xref      = Validator::queryParams($request)->isXref()->string('xref');
        $submitter = Registry::submitterFactory()->make($xref, $tree);
Severity: Major
Found in app/Module/ClippingsCartModule.php and 3 other locations - About 1 hr to fix
app/Module/ClippingsCartModule.php on lines 567..577
app/Module/ClippingsCartModule.php on lines 601..611
app/Module/ClippingsCartModule.php on lines 635..645

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 110.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 13 locations. Consider refactoring.
Open

<?php

/**
 * webtrees: online genealogy
 * Copyright (C) 2023 webtrees development team
Severity: Major
Found in app/Elements/MarriageLicence.php and 12 other locations - About 1 hr to fix
app/Elements/Adoption.php on lines 1..46
app/Elements/Annulment.php on lines 1..46
app/Elements/Birth.php on lines 1..46
app/Elements/CustomFamilyEvent.php on lines 1..46
app/Elements/Divorce.php on lines 1..46
app/Elements/DivorceFiled.php on lines 1..46
app/Elements/Engagement.php on lines 1..46
app/Elements/FamilyCensus.php on lines 1..46
app/Elements/Marriage.php on lines 1..46
app/Elements/MarriageBanns.php on lines 1..46
app/Elements/MarriageContract.php on lines 1..46
app/Elements/MarriageSettlement.php on lines 1..46

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 110.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 13 locations. Consider refactoring.
Open

<?php

/**
 * webtrees: online genealogy
 * Copyright (C) 2023 webtrees development team
Severity: Major
Found in app/Elements/Birth.php and 12 other locations - About 1 hr to fix
app/Elements/Adoption.php on lines 1..46
app/Elements/Annulment.php on lines 1..46
app/Elements/CustomFamilyEvent.php on lines 1..46
app/Elements/Divorce.php on lines 1..46
app/Elements/DivorceFiled.php on lines 1..46
app/Elements/Engagement.php on lines 1..46
app/Elements/FamilyCensus.php on lines 1..46
app/Elements/Marriage.php on lines 1..46
app/Elements/MarriageBanns.php on lines 1..46
app/Elements/MarriageContract.php on lines 1..46
app/Elements/MarriageLicence.php on lines 1..46
app/Elements/MarriageSettlement.php on lines 1..46

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 110.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 13 locations. Consider refactoring.
Open

<?php

/**
 * webtrees: online genealogy
 * Copyright (C) 2023 webtrees development team
Severity: Major
Found in app/Elements/Divorce.php and 12 other locations - About 1 hr to fix
app/Elements/Adoption.php on lines 1..46
app/Elements/Annulment.php on lines 1..46
app/Elements/Birth.php on lines 1..46
app/Elements/CustomFamilyEvent.php on lines 1..46
app/Elements/DivorceFiled.php on lines 1..46
app/Elements/Engagement.php on lines 1..46
app/Elements/FamilyCensus.php on lines 1..46
app/Elements/Marriage.php on lines 1..46
app/Elements/MarriageBanns.php on lines 1..46
app/Elements/MarriageContract.php on lines 1..46
app/Elements/MarriageLicence.php on lines 1..46
app/Elements/MarriageSettlement.php on lines 1..46

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 110.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 13 locations. Consider refactoring.
Open

<?php

/**
 * webtrees: online genealogy
 * Copyright (C) 2023 webtrees development team
Severity: Major
Found in app/Elements/DivorceFiled.php and 12 other locations - About 1 hr to fix
app/Elements/Adoption.php on lines 1..46
app/Elements/Annulment.php on lines 1..46
app/Elements/Birth.php on lines 1..46
app/Elements/CustomFamilyEvent.php on lines 1..46
app/Elements/Divorce.php on lines 1..46
app/Elements/Engagement.php on lines 1..46
app/Elements/FamilyCensus.php on lines 1..46
app/Elements/Marriage.php on lines 1..46
app/Elements/MarriageBanns.php on lines 1..46
app/Elements/MarriageContract.php on lines 1..46
app/Elements/MarriageLicence.php on lines 1..46
app/Elements/MarriageSettlement.php on lines 1..46

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 110.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 13 locations. Consider refactoring.
Open

<?php

/**
 * webtrees: online genealogy
 * Copyright (C) 2023 webtrees development team
Severity: Major
Found in app/Elements/MarriageSettlement.php and 12 other locations - About 1 hr to fix
app/Elements/Adoption.php on lines 1..46
app/Elements/Annulment.php on lines 1..46
app/Elements/Birth.php on lines 1..46
app/Elements/CustomFamilyEvent.php on lines 1..46
app/Elements/Divorce.php on lines 1..46
app/Elements/DivorceFiled.php on lines 1..46
app/Elements/Engagement.php on lines 1..46
app/Elements/FamilyCensus.php on lines 1..46
app/Elements/Marriage.php on lines 1..46
app/Elements/MarriageBanns.php on lines 1..46
app/Elements/MarriageContract.php on lines 1..46
app/Elements/MarriageLicence.php on lines 1..46

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 110.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 13 locations. Consider refactoring.
Open

<?php

/**
 * webtrees: online genealogy
 * Copyright (C) 2023 webtrees development team
Severity: Major
Found in app/Elements/MarriageBanns.php and 12 other locations - About 1 hr to fix
app/Elements/Adoption.php on lines 1..46
app/Elements/Annulment.php on lines 1..46
app/Elements/Birth.php on lines 1..46
app/Elements/CustomFamilyEvent.php on lines 1..46
app/Elements/Divorce.php on lines 1..46
app/Elements/DivorceFiled.php on lines 1..46
app/Elements/Engagement.php on lines 1..46
app/Elements/FamilyCensus.php on lines 1..46
app/Elements/Marriage.php on lines 1..46
app/Elements/MarriageContract.php on lines 1..46
app/Elements/MarriageLicence.php on lines 1..46
app/Elements/MarriageSettlement.php on lines 1..46

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 110.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

    public function postAddLocationAction(ServerRequestInterface $request): ResponseInterface
    {
        $tree     = Validator::attributes($request)->tree();
        $xref     = Validator::queryParams($request)->isXref()->string('xref');
        $location = Registry::locationFactory()->make($xref, $tree);
Severity: Major
Found in app/Module/ClippingsCartModule.php and 3 other locations - About 1 hr to fix
app/Module/ClippingsCartModule.php on lines 601..611
app/Module/ClippingsCartModule.php on lines 635..645
app/Module/ClippingsCartModule.php on lines 753..763

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 110.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

    public function postAddMediaAction(ServerRequestInterface $request): ResponseInterface
    {
        $tree  = Validator::attributes($request)->tree();
        $xref  = Validator::queryParams($request)->isXref()->string('xref');
        $media = Registry::mediaFactory()->make($xref, $tree);
Severity: Major
Found in app/Module/ClippingsCartModule.php and 3 other locations - About 1 hr to fix
app/Module/ClippingsCartModule.php on lines 567..577
app/Module/ClippingsCartModule.php on lines 635..645
app/Module/ClippingsCartModule.php on lines 753..763

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 110.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Severity
Category
Status
Source
Language