fisharebest/webtrees

View on GitHub

Showing 675 of 2,402 total issues

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

<?php

/**
 * webtrees: online genealogy
 * Copyright (C) 2023 webtrees development team
Severity: Major
Found in app/Census/CensusOfScotland1851.php and 20 other locations - About 4 hrs to fix
app/Census/CensusOfEngland1851.php on lines 1..55
app/Census/CensusOfEngland1861.php on lines 1..55
app/Census/CensusOfEngland1871.php on lines 1..55
app/Census/CensusOfEngland1881.php on lines 1..55
app/Census/CensusOfFrance1901.php on lines 1..55
app/Census/CensusOfFrance1906.php on lines 1..55
app/Census/CensusOfFrance1911.php on lines 1..55
app/Census/CensusOfFrance1921.php on lines 1..55
app/Census/CensusOfFrance1926.php on lines 1..55
app/Census/CensusOfFrance1931.php on lines 1..55
app/Census/CensusOfFrance1936.php on lines 1..55
app/Census/CensusOfScotland1881.php on lines 1..55
app/Census/CensusOfUnitedStates1790.php on lines 1..55
app/Census/CensusOfWales1851.php on lines 1..55
app/Census/CensusOfWales1861.php on lines 1..55
app/Census/CensusOfWales1871.php on lines 1..55
app/Census/CensusOfWales1881.php on lines 1..55
app/Census/RegisterOfEngland1939.php on lines 1..55
app/Census/RegisterOfScotland1939.php on lines 1..55
app/Census/RegisterOfWales1939.php on lines 1..55

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

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

<?php

/**
 * webtrees: online genealogy
 * Copyright (C) 2023 webtrees development team
Severity: Major
Found in app/Census/CensusOfWales1851.php and 20 other locations - About 4 hrs to fix
app/Census/CensusOfEngland1851.php on lines 1..55
app/Census/CensusOfEngland1861.php on lines 1..55
app/Census/CensusOfEngland1871.php on lines 1..55
app/Census/CensusOfEngland1881.php on lines 1..55
app/Census/CensusOfFrance1901.php on lines 1..55
app/Census/CensusOfFrance1906.php on lines 1..55
app/Census/CensusOfFrance1911.php on lines 1..55
app/Census/CensusOfFrance1921.php on lines 1..55
app/Census/CensusOfFrance1926.php on lines 1..55
app/Census/CensusOfFrance1931.php on lines 1..55
app/Census/CensusOfFrance1936.php on lines 1..55
app/Census/CensusOfScotland1851.php on lines 1..55
app/Census/CensusOfScotland1881.php on lines 1..55
app/Census/CensusOfUnitedStates1790.php on lines 1..55
app/Census/CensusOfWales1861.php on lines 1..55
app/Census/CensusOfWales1871.php on lines 1..55
app/Census/CensusOfWales1881.php on lines 1..55
app/Census/RegisterOfEngland1939.php on lines 1..55
app/Census/RegisterOfScotland1939.php on lines 1..55
app/Census/RegisterOfWales1939.php on lines 1..55

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

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

<?php

/**
 * webtrees: online genealogy
 * Copyright (C) 2023 webtrees development team
Severity: Major
Found in app/Census/CensusOfScotland1881.php and 20 other locations - About 4 hrs to fix
app/Census/CensusOfEngland1851.php on lines 1..55
app/Census/CensusOfEngland1861.php on lines 1..55
app/Census/CensusOfEngland1871.php on lines 1..55
app/Census/CensusOfEngland1881.php on lines 1..55
app/Census/CensusOfFrance1901.php on lines 1..55
app/Census/CensusOfFrance1906.php on lines 1..55
app/Census/CensusOfFrance1911.php on lines 1..55
app/Census/CensusOfFrance1921.php on lines 1..55
app/Census/CensusOfFrance1926.php on lines 1..55
app/Census/CensusOfFrance1931.php on lines 1..55
app/Census/CensusOfFrance1936.php on lines 1..55
app/Census/CensusOfScotland1851.php on lines 1..55
app/Census/CensusOfUnitedStates1790.php on lines 1..55
app/Census/CensusOfWales1851.php on lines 1..55
app/Census/CensusOfWales1861.php on lines 1..55
app/Census/CensusOfWales1871.php on lines 1..55
app/Census/CensusOfWales1881.php on lines 1..55
app/Census/RegisterOfEngland1939.php on lines 1..55
app/Census/RegisterOfScotland1939.php on lines 1..55
app/Census/RegisterOfWales1939.php on lines 1..55

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

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

<?php

/**
 * webtrees: online genealogy
 * Copyright (C) 2023 webtrees development team
Severity: Major
Found in app/Census/CensusOfEngland1881.php and 20 other locations - About 4 hrs to fix
app/Census/CensusOfEngland1851.php on lines 1..55
app/Census/CensusOfEngland1861.php on lines 1..55
app/Census/CensusOfEngland1871.php on lines 1..55
app/Census/CensusOfFrance1901.php on lines 1..55
app/Census/CensusOfFrance1906.php on lines 1..55
app/Census/CensusOfFrance1911.php on lines 1..55
app/Census/CensusOfFrance1921.php on lines 1..55
app/Census/CensusOfFrance1926.php on lines 1..55
app/Census/CensusOfFrance1931.php on lines 1..55
app/Census/CensusOfFrance1936.php on lines 1..55
app/Census/CensusOfScotland1851.php on lines 1..55
app/Census/CensusOfScotland1881.php on lines 1..55
app/Census/CensusOfUnitedStates1790.php on lines 1..55
app/Census/CensusOfWales1851.php on lines 1..55
app/Census/CensusOfWales1861.php on lines 1..55
app/Census/CensusOfWales1871.php on lines 1..55
app/Census/CensusOfWales1881.php on lines 1..55
app/Census/RegisterOfEngland1939.php on lines 1..55
app/Census/RegisterOfScotland1939.php on lines 1..55
app/Census/RegisterOfWales1939.php on lines 1..55

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

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

<?php

/**
 * webtrees: online genealogy
 * Copyright (C) 2023 webtrees development team
Severity: Major
Found in app/Census/CensusOfWales1871.php and 20 other locations - About 4 hrs to fix
app/Census/CensusOfEngland1851.php on lines 1..55
app/Census/CensusOfEngland1861.php on lines 1..55
app/Census/CensusOfEngland1871.php on lines 1..55
app/Census/CensusOfEngland1881.php on lines 1..55
app/Census/CensusOfFrance1901.php on lines 1..55
app/Census/CensusOfFrance1906.php on lines 1..55
app/Census/CensusOfFrance1911.php on lines 1..55
app/Census/CensusOfFrance1921.php on lines 1..55
app/Census/CensusOfFrance1926.php on lines 1..55
app/Census/CensusOfFrance1931.php on lines 1..55
app/Census/CensusOfFrance1936.php on lines 1..55
app/Census/CensusOfScotland1851.php on lines 1..55
app/Census/CensusOfScotland1881.php on lines 1..55
app/Census/CensusOfUnitedStates1790.php on lines 1..55
app/Census/CensusOfWales1851.php on lines 1..55
app/Census/CensusOfWales1861.php on lines 1..55
app/Census/CensusOfWales1881.php on lines 1..55
app/Census/RegisterOfEngland1939.php on lines 1..55
app/Census/RegisterOfScotland1939.php on lines 1..55
app/Census/RegisterOfWales1939.php on lines 1..55

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

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

<?php

/**
 * webtrees: online genealogy
 * Copyright (C) 2023 webtrees development team
Severity: Major
Found in app/Census/CensusOfFrance1931.php and 20 other locations - About 4 hrs to fix
app/Census/CensusOfEngland1851.php on lines 1..55
app/Census/CensusOfEngland1861.php on lines 1..55
app/Census/CensusOfEngland1871.php on lines 1..55
app/Census/CensusOfEngland1881.php on lines 1..55
app/Census/CensusOfFrance1901.php on lines 1..55
app/Census/CensusOfFrance1906.php on lines 1..55
app/Census/CensusOfFrance1911.php on lines 1..55
app/Census/CensusOfFrance1921.php on lines 1..55
app/Census/CensusOfFrance1926.php on lines 1..55
app/Census/CensusOfFrance1936.php on lines 1..55
app/Census/CensusOfScotland1851.php on lines 1..55
app/Census/CensusOfScotland1881.php on lines 1..55
app/Census/CensusOfUnitedStates1790.php on lines 1..55
app/Census/CensusOfWales1851.php on lines 1..55
app/Census/CensusOfWales1861.php on lines 1..55
app/Census/CensusOfWales1871.php on lines 1..55
app/Census/CensusOfWales1881.php on lines 1..55
app/Census/RegisterOfEngland1939.php on lines 1..55
app/Census/RegisterOfScotland1939.php on lines 1..55
app/Census/RegisterOfWales1939.php on lines 1..55

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

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

<?php

/**
 * webtrees: online genealogy
 * Copyright (C) 2023 webtrees development team
Severity: Major
Found in app/Census/CensusOfEngland1851.php and 20 other locations - About 4 hrs to fix
app/Census/CensusOfEngland1861.php on lines 1..55
app/Census/CensusOfEngland1871.php on lines 1..55
app/Census/CensusOfEngland1881.php on lines 1..55
app/Census/CensusOfFrance1901.php on lines 1..55
app/Census/CensusOfFrance1906.php on lines 1..55
app/Census/CensusOfFrance1911.php on lines 1..55
app/Census/CensusOfFrance1921.php on lines 1..55
app/Census/CensusOfFrance1926.php on lines 1..55
app/Census/CensusOfFrance1931.php on lines 1..55
app/Census/CensusOfFrance1936.php on lines 1..55
app/Census/CensusOfScotland1851.php on lines 1..55
app/Census/CensusOfScotland1881.php on lines 1..55
app/Census/CensusOfUnitedStates1790.php on lines 1..55
app/Census/CensusOfWales1851.php on lines 1..55
app/Census/CensusOfWales1861.php on lines 1..55
app/Census/CensusOfWales1871.php on lines 1..55
app/Census/CensusOfWales1881.php on lines 1..55
app/Census/RegisterOfEngland1939.php on lines 1..55
app/Census/RegisterOfScotland1939.php on lines 1..55
app/Census/RegisterOfWales1939.php on lines 1..55

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

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

<?php

/**
 * webtrees: online genealogy
 * Copyright (C) 2023 webtrees development team
Severity: Major
Found in app/Census/CensusOfFrance1936.php and 20 other locations - About 4 hrs to fix
app/Census/CensusOfEngland1851.php on lines 1..55
app/Census/CensusOfEngland1861.php on lines 1..55
app/Census/CensusOfEngland1871.php on lines 1..55
app/Census/CensusOfEngland1881.php on lines 1..55
app/Census/CensusOfFrance1901.php on lines 1..55
app/Census/CensusOfFrance1906.php on lines 1..55
app/Census/CensusOfFrance1911.php on lines 1..55
app/Census/CensusOfFrance1921.php on lines 1..55
app/Census/CensusOfFrance1926.php on lines 1..55
app/Census/CensusOfFrance1931.php on lines 1..55
app/Census/CensusOfScotland1851.php on lines 1..55
app/Census/CensusOfScotland1881.php on lines 1..55
app/Census/CensusOfUnitedStates1790.php on lines 1..55
app/Census/CensusOfWales1851.php on lines 1..55
app/Census/CensusOfWales1861.php on lines 1..55
app/Census/CensusOfWales1871.php on lines 1..55
app/Census/CensusOfWales1881.php on lines 1..55
app/Census/RegisterOfEngland1939.php on lines 1..55
app/Census/RegisterOfScotland1939.php on lines 1..55
app/Census/RegisterOfWales1939.php on lines 1..55

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

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 addIndividualToCart(Individual $individual): void
    {
        $cart = Session::get('cart');
        $cart = is_array($cart) ? $cart : [];

Severity: Major
Found in app/Module/ClippingsCartModule.php and 1 other location - About 4 hrs to fix
app/Module/ClippingsCartModule.php on lines 810..828

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

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 addLocationToCart(Location $location): void
    {
        $cart = Session::get('cart');
        $cart = is_array($cart) ? $cart : [];

Severity: Major
Found in app/Module/ClippingsCartModule.php and 1 other location - About 4 hrs to fix
app/Module/ClippingsCartModule.php on lines 790..808

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

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

<?php

/**
 * webtrees: online genealogy
 * Copyright (C) 2023 webtrees development team
Severity: Major
Found in app/Http/RequestHandlers/PendingChangesRejectChange.php and 1 other location - About 4 hrs to fix
app/Http/RequestHandlers/PendingChangesAcceptChange.php on lines 1..65

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

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

<?php

/**
 * webtrees: online genealogy
 * Copyright (C) 2023 webtrees development team
Severity: Major
Found in app/Http/RequestHandlers/PendingChangesAcceptChange.php and 1 other location - About 4 hrs to fix
app/Http/RequestHandlers/PendingChangesRejectChange.php on lines 1..65

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

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

    protected function normalizeExceptions(): array
    {
        return [
            'C' . UTF8::COMBINING_CARON                => UTF8::LATIN_CAPITAL_LETTER_C_WITH_CARON,
            'C' . UTF8::COMBINING_CEDILLA              => UTF8::LATIN_CAPITAL_LETTER_C_WITH_ACUTE,
Severity: Major
Found in app/Module/LanguageSlovenian.php and 1 other location - About 3 hrs to fix
app/Module/LanguageSerbianLatin.php on lines 101..115

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

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

    protected function normalizeExceptions(): array
    {
        return [
            'C' . UTF8::COMBINING_CARON                => UTF8::LATIN_CAPITAL_LETTER_C_WITH_CARON,
            'C' . UTF8::COMBINING_CEDILLA              => UTF8::LATIN_CAPITAL_LETTER_C_WITH_ACUTE,
Severity: Major
Found in app/Module/LanguageSerbianLatin.php and 1 other location - About 3 hrs to fix
app/Module/LanguageSlovenian.php on lines 98..112

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

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

    private const ALL_EVENTS = [
        'ADOP' => 'INDI:ADOP',
        'ANUL' => 'FAM:ANUL',
        'BAPM' => 'INDI:BAPM',
        'BARM' => 'INDI:BARM',
Severity: Major
Found in app/Module/UpcomingAnniversariesModule.php and 1 other location - About 3 hrs to fix
app/Module/OnThisDayModule.php on lines 55..86

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

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

    private const ALL_EVENTS = [
        'ADOP' => 'INDI:ADOP',
        'ANUL' => 'FAM:ANUL',
        'BAPM' => 'INDI:BAPM',
        'BARM' => 'INDI:BARM',
Severity: Major
Found in app/Module/OnThisDayModule.php and 1 other location - About 3 hrs to fix
app/Module/UpcomingAnniversariesModule.php on lines 65..96

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

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

<?php

/**
 * webtrees: online genealogy
 * Copyright (C) 2023 webtrees development team
Severity: Major
Found in app/Http/RequestHandlers/TreePageDefaultUpdate.php and 1 other location - About 3 hrs to fix
app/Http/RequestHandlers/UserPageDefaultUpdate.php on lines 1..62

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

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

<?php

/**
 * webtrees: online genealogy
 * Copyright (C) 2023 webtrees development team
Severity: Major
Found in app/Http/RequestHandlers/UserPageDefaultUpdate.php and 1 other location - About 3 hrs to fix
app/Http/RequestHandlers/TreePageDefaultUpdate.php on lines 1..62

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

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

    private function individualsWithTasks(Tree $tree, int $max_julian_day): Collection
    {
        return DB::table('individuals')
            ->join('dates', static function (JoinClause $join): void {
                $join
Severity: Major
Found in app/Module/ResearchTaskModule.php and 1 other location - About 3 hrs to fix
app/Module/ResearchTaskModule.php on lines 185..201

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

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 newSpouseNames(Individual $spouse, string $sex): array
    {
        if ($sex === 'F' && preg_match(self::REGEX_SPFX_SURN, $this->extractName($spouse), $match) === 1) {
            $name = $match['NAME'];
            $spfx = $match['SPFX'];
Severity: Major
Found in app/SurnameTradition/PaternalSurnameTradition.php and 1 other location - About 3 hrs to fix
app/SurnameTradition/PaternalSurnameTradition.php on lines 62..76

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

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