fisharebest/webtrees

View on GitHub

Showing 673 of 2,400 total issues

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

            return $cache->remember($key, function () use ($place) {
                $request = $this->createPlaceNameSearchRequest($place);

                $client = new Client([
                    'timeout' => 3,
Severity: Minor
Found in app/Module/ModuleMapAutocompleteTrait.php and 1 other location - About 45 mins to fix
app/Module/ModuleMapGeoLocationTrait.php on lines 74..88

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 96.

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

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

        if ($block_order !== null && $swap_block !== null) {
            DB::table('block')
                ->where('block_id', '=', $block_id)
                ->update([
                    'block_order' => $swap_block->block_order,
Severity: Minor
Found in app/Module/FrequentlyAskedQuestionsModule.php and 1 other location - About 45 mins to fix
app/Module/FrequentlyAskedQuestionsModule.php on lines 262..274

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 95.

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

    protected function submittersToFix(Tree $tree, array $params): Collection|null
    {
        if ($params['type'] !== Submitter::RECORD_TYPE || $params['search-for'] === '') {
            return null;
        }
Severity: Minor
Found in app/Module/FixSearchAndReplace.php and 1 other location - About 45 mins to fix
app/Module/FixSearchAndReplace.php on lines 275..286

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 95.

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

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

        if ($block_order !== null && $swap_block !== null) {
            DB::table('block')
                ->where('block_id', '=', $block_id)
                ->update([
                    'block_order' => $swap_block->block_order,
Severity: Minor
Found in app/Module/FrequentlyAskedQuestionsModule.php and 1 other location - About 45 mins to fix
app/Module/FrequentlyAskedQuestionsModule.php on lines 226..238

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 95.

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

    protected function sourcesToFix(Tree $tree, array $params): Collection|null
    {
        if ($params['type'] !== Source::RECORD_TYPE || $params['search-for'] === '') {
            return null;
        }
Severity: Minor
Found in app/Module/FixSearchAndReplace.php and 1 other location - About 45 mins to fix
app/Module/FixSearchAndReplace.php on lines 297..308

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 95.

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 11 locations. Consider refactoring.
Open

<?php

/**
 * webtrees: online genealogy
 * Copyright (C) 2023 webtrees development team
Severity: Major
Found in app/Contracts/SubmissionFactoryInterface.php and 10 other locations - About 40 mins to fix
app/Contracts/FamilyFactoryInterface.php on lines 1..57
app/Contracts/HeaderFactoryInterface.php on lines 1..57
app/Contracts/IndividualFactoryInterface.php on lines 1..57
app/Contracts/LocationFactoryInterface.php on lines 1..57
app/Contracts/MediaFactoryInterface.php on lines 1..57
app/Contracts/NoteFactoryInterface.php on lines 1..57
app/Contracts/RepositoryFactoryInterface.php on lines 1..57
app/Contracts/SharedNoteFactoryInterface.php on lines 1..57
app/Contracts/SourceFactoryInterface.php on lines 1..57
app/Contracts/SubmitterFactoryInterface.php on lines 1..57

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 94.

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 8 locations. Consider refactoring.
Open

                        case 'fr_CA':
                            if ($sex2 === 'M') {
                                return I18N::translate('great ×%s grandfather', I18N::number($up - 1));
                            }

Severity: Major
Found in app/Services/RelationshipService.php and 7 other locations - About 40 mins to fix
app/Services/RelationshipService.php on lines 1434..1443
app/Services/RelationshipService.php on lines 1476..1486
app/Services/RelationshipService.php on lines 1769..1778
app/Services/RelationshipService.php on lines 1780..1790
app/Services/RelationshipService.php on lines 1886..1895
app/Services/RelationshipService.php on lines 1935..1947
app/Services/RelationshipService.php on lines 2045..2054

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 94.

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

<?php

/**
 * webtrees: online genealogy
 * Copyright (C) 2023 webtrees development team
Severity: Major
Found in app/Elements/NamePiecePrefix.php and 3 other locations - About 40 mins to fix
app/Elements/NamePieceNickname.php on lines 1..53
app/Elements/NamePieceSuffix.php on lines 1..57
app/Elements/NamePieceSurnamePrefix.php on lines 1..54

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 94.

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 3 locations. Consider refactoring.
Open

                        case 'ko': // Source : Jeongwan Nam (jeongwann@gmail.com)
                            if ($sex2 === 'M') {
                                return I18N::translate('great ×%s grandson', I18N::number($up + 1));
                            }

Severity: Major
Found in app/Services/RelationshipService.php and 2 other locations - About 40 mins to fix
app/Services/RelationshipService.php on lines 1464..1474
app/Services/RelationshipService.php on lines 1923..1932

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 94.

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 3 locations. Consider refactoring.
Open

                        case 'ko': // Source : Jeongwan Nam (jeongwann@gmail.com)
                            if ($sex2 === 'M') {
                                return I18N::translate('great ×%s grandfather', I18N::number($up + 1));
                            }

Severity: Major
Found in app/Services/RelationshipService.php and 2 other locations - About 40 mins to fix
app/Services/RelationshipService.php on lines 1464..1474
app/Services/RelationshipService.php on lines 2056..2065

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 94.

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 11 locations. Consider refactoring.
Open

<?php

/**
 * webtrees: online genealogy
 * Copyright (C) 2023 webtrees development team
Severity: Major
Found in app/Contracts/SourceFactoryInterface.php and 10 other locations - About 40 mins to fix
app/Contracts/FamilyFactoryInterface.php on lines 1..57
app/Contracts/HeaderFactoryInterface.php on lines 1..57
app/Contracts/IndividualFactoryInterface.php on lines 1..57
app/Contracts/LocationFactoryInterface.php on lines 1..57
app/Contracts/MediaFactoryInterface.php on lines 1..57
app/Contracts/NoteFactoryInterface.php on lines 1..57
app/Contracts/RepositoryFactoryInterface.php on lines 1..57
app/Contracts/SharedNoteFactoryInterface.php on lines 1..57
app/Contracts/SubmissionFactoryInterface.php on lines 1..57
app/Contracts/SubmitterFactoryInterface.php on lines 1..57

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 94.

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 8 locations. Consider refactoring.
Open

                        case 'hi': // Source: MrQD
                            if ($sex2 === 'M') {
                                // I18N: if you need a different number for %s, contact the developers, as a code-change is required
                                return I18N::translate('great ×%s uncle', I18N::number($up - 2));
                            }
Severity: Major
Found in app/Services/RelationshipService.php and 7 other locations - About 40 mins to fix
app/Services/RelationshipService.php on lines 1434..1443
app/Services/RelationshipService.php on lines 1769..1778
app/Services/RelationshipService.php on lines 1780..1790
app/Services/RelationshipService.php on lines 1886..1895
app/Services/RelationshipService.php on lines 1912..1921
app/Services/RelationshipService.php on lines 1935..1947
app/Services/RelationshipService.php on lines 2045..2054

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 94.

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 8 locations. Consider refactoring.
Open

                        case 'da': // Source: Patrick Sorensen
                            if ($sex2 === 'M') {
                                return I18N::translate('great ×%s grandfather', I18N::number($up - 3));
                            }

Severity: Major
Found in app/Services/RelationshipService.php and 7 other locations - About 40 mins to fix
app/Services/RelationshipService.php on lines 1434..1443
app/Services/RelationshipService.php on lines 1476..1486
app/Services/RelationshipService.php on lines 1769..1778
app/Services/RelationshipService.php on lines 1780..1790
app/Services/RelationshipService.php on lines 1912..1921
app/Services/RelationshipService.php on lines 1935..1947
app/Services/RelationshipService.php on lines 2045..2054

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 94.

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 8 locations. Consider refactoring.
Open

                        case 'hi': // Source: MrQD.
                            if ($sex2 === 'M') {
                                // I18N: if you need a different number for %s, contact the developers, as a code-change is required
                                return I18N::translate('great ×%s nephew', I18N::number($down - 3));
                            }
Severity: Major
Found in app/Services/RelationshipService.php and 7 other locations - About 40 mins to fix
app/Services/RelationshipService.php on lines 1434..1443
app/Services/RelationshipService.php on lines 1476..1486
app/Services/RelationshipService.php on lines 1769..1778
app/Services/RelationshipService.php on lines 1886..1895
app/Services/RelationshipService.php on lines 1912..1921
app/Services/RelationshipService.php on lines 1935..1947
app/Services/RelationshipService.php on lines 2045..2054

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 94.

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 11 locations. Consider refactoring.
Open

<?php

/**
 * webtrees: online genealogy
 * Copyright (C) 2023 webtrees development team
Severity: Major
Found in app/Contracts/NoteFactoryInterface.php and 10 other locations - About 40 mins to fix
app/Contracts/FamilyFactoryInterface.php on lines 1..57
app/Contracts/HeaderFactoryInterface.php on lines 1..57
app/Contracts/IndividualFactoryInterface.php on lines 1..57
app/Contracts/LocationFactoryInterface.php on lines 1..57
app/Contracts/MediaFactoryInterface.php on lines 1..57
app/Contracts/RepositoryFactoryInterface.php on lines 1..57
app/Contracts/SharedNoteFactoryInterface.php on lines 1..57
app/Contracts/SourceFactoryInterface.php on lines 1..57
app/Contracts/SubmissionFactoryInterface.php on lines 1..57
app/Contracts/SubmitterFactoryInterface.php on lines 1..57

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 94.

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 11 locations. Consider refactoring.
Open

<?php

/**
 * webtrees: online genealogy
 * Copyright (C) 2023 webtrees development team
Severity: Major
Found in app/Contracts/SharedNoteFactoryInterface.php and 10 other locations - About 40 mins to fix
app/Contracts/FamilyFactoryInterface.php on lines 1..57
app/Contracts/HeaderFactoryInterface.php on lines 1..57
app/Contracts/IndividualFactoryInterface.php on lines 1..57
app/Contracts/LocationFactoryInterface.php on lines 1..57
app/Contracts/MediaFactoryInterface.php on lines 1..57
app/Contracts/NoteFactoryInterface.php on lines 1..57
app/Contracts/RepositoryFactoryInterface.php on lines 1..57
app/Contracts/SourceFactoryInterface.php on lines 1..57
app/Contracts/SubmissionFactoryInterface.php on lines 1..57
app/Contracts/SubmitterFactoryInterface.php on lines 1..57

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 94.

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 11 locations. Consider refactoring.
Open

<?php

/**
 * webtrees: online genealogy
 * Copyright (C) 2023 webtrees development team
Severity: Major
Found in app/Contracts/HeaderFactoryInterface.php and 10 other locations - About 40 mins to fix
app/Contracts/FamilyFactoryInterface.php on lines 1..57
app/Contracts/IndividualFactoryInterface.php on lines 1..57
app/Contracts/LocationFactoryInterface.php on lines 1..57
app/Contracts/MediaFactoryInterface.php on lines 1..57
app/Contracts/NoteFactoryInterface.php on lines 1..57
app/Contracts/RepositoryFactoryInterface.php on lines 1..57
app/Contracts/SharedNoteFactoryInterface.php on lines 1..57
app/Contracts/SourceFactoryInterface.php on lines 1..57
app/Contracts/SubmissionFactoryInterface.php on lines 1..57
app/Contracts/SubmitterFactoryInterface.php on lines 1..57

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 94.

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 8 locations. Consider refactoring.
Open

                        case 'da':
                            if ($sex2 === 'M') {
                                return I18N::translate('great ×%s uncle', I18N::number($up - 4));
                            }

Severity: Major
Found in app/Services/RelationshipService.php and 7 other locations - About 40 mins to fix
app/Services/RelationshipService.php on lines 1476..1486
app/Services/RelationshipService.php on lines 1769..1778
app/Services/RelationshipService.php on lines 1780..1790
app/Services/RelationshipService.php on lines 1886..1895
app/Services/RelationshipService.php on lines 1912..1921
app/Services/RelationshipService.php on lines 1935..1947
app/Services/RelationshipService.php on lines 2045..2054

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 94.

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

<?php

/**
 * webtrees: online genealogy
 * Copyright (C) 2023 webtrees development team
Severity: Major
Found in app/Elements/NamePieceNickname.php and 3 other locations - About 40 mins to fix
app/Elements/NamePiecePrefix.php on lines 1..57
app/Elements/NamePieceSuffix.php on lines 1..57
app/Elements/NamePieceSurnamePrefix.php on lines 1..54

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 94.

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 11 locations. Consider refactoring.
Open

<?php

/**
 * webtrees: online genealogy
 * Copyright (C) 2023 webtrees development team
Severity: Major
Found in app/Contracts/MediaFactoryInterface.php and 10 other locations - About 40 mins to fix
app/Contracts/FamilyFactoryInterface.php on lines 1..57
app/Contracts/HeaderFactoryInterface.php on lines 1..57
app/Contracts/IndividualFactoryInterface.php on lines 1..57
app/Contracts/LocationFactoryInterface.php on lines 1..57
app/Contracts/NoteFactoryInterface.php on lines 1..57
app/Contracts/RepositoryFactoryInterface.php on lines 1..57
app/Contracts/SharedNoteFactoryInterface.php on lines 1..57
app/Contracts/SourceFactoryInterface.php on lines 1..57
app/Contracts/SubmissionFactoryInterface.php on lines 1..57
app/Contracts/SubmitterFactoryInterface.php on lines 1..57

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 94.

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