wikimedia/pywikibot

View on GitHub
pywikibot/date.py

Summary

Maintainability
F
6 days
Test Coverage

File date.py has 1677 lines of code (exceeds 900 allowed). Consider refactoring.
Open

"""Date data and manipulation module."""
#
# (C) Pywikibot team, 2003-2024
#
# Distributed under the terms of the MIT license.
Severity: Major
Found in pywikibot/date.py - About 2 days to fix

    XXX found
    Open

                     'XXVII', 'XXVIII', 'XXIX', 'XXX']
    Severity: Minor
    Found in pywikibot/date.py by fixme

    TODO found
    Open

    # TODO: Before compat 19d1cf9e (2006), there was a 'step' in the tuple,
    Severity: Minor
    Found in pywikibot/date.py by fixme

    FIXME found
    Open

            'nn': lambda v: dh_decAD(v, '%d0-åra'),  # FIXME: not sure of this one
    Severity: Minor
    Found in pywikibot/date.py by fixme

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

            (lambda v: dh_centuryAD(v, '%dst ' + period),
             lambda p: p == 1 or (p > 20 and p % 10 == 1)),
    Severity: Major
    Found in pywikibot/date.py and 2 other locations - About 2 hrs to fix
    pywikibot/date.py on lines 715..716
    pywikibot/date.py on lines 717..718

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

    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

            (lambda v: dh_centuryAD(v, '%drd ' + period),
             lambda p: p == 3 or (p > 20 and p % 10 == 3)),
    Severity: Major
    Found in pywikibot/date.py and 2 other locations - About 2 hrs to fix
    pywikibot/date.py on lines 713..714
    pywikibot/date.py on lines 715..716

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

    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

            (lambda v: dh_centuryAD(v, '%dnd ' + period),
             lambda p: p == 2 or (p > 20 and p % 10 == 2)),
    Severity: Major
    Found in pywikibot/date.py and 2 other locations - About 2 hrs to fix
    pywikibot/date.py on lines 713..714
    pywikibot/date.py on lines 717..718

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

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

            'fa': lambda m: multi(m, [
                (lambda v: dh_constVal(v, 20, 'سده ۲۰ (میلادی)'),
                 lambda p: p == 20),
                # This is a dummy value, just to avoid validation testing.
                # Later, it should be replaced with a proper 'fa' titles
    Severity: Major
    Found in pywikibot/date.py and 5 other locations - About 1 hr to fix
    pywikibot/date.py on lines 972..975
    pywikibot/date.py on lines 1040..1043
    pywikibot/date.py on lines 1113..1118
    pywikibot/date.py on lines 1232..1235
    pywikibot/date.py on lines 1342..1344

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

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

            'hi': lambda m: multi(m, [
                (lambda v: dh_constVal(v, 20, 'बीसवी शताब्दी'), lambda p: p == 20),
                # This is a dummy value, just to avoid validation testing.
                # Later, it should be replaced with a proper 'fa' titles
                (lambda v: dh_centuryAD(v, '%dth century'),
    Severity: Major
    Found in pywikibot/date.py and 5 other locations - About 1 hr to fix
    pywikibot/date.py on lines 972..975
    pywikibot/date.py on lines 1040..1043
    pywikibot/date.py on lines 1096..1102
    pywikibot/date.py on lines 1232..1235
    pywikibot/date.py on lines 1342..1344

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

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

            'ro': lambda m: multi(m, [
                (lambda v: dh_constVal(v, 0, 'Primul deceniu d.Hr.'),
                 lambda p: p == 0),
                (lambda v: dh_decAD(v, 'Anii %d'), alwaysTrue)]),
    Severity: Major
    Found in pywikibot/date.py and 5 other locations - About 1 hr to fix
    pywikibot/date.py on lines 1040..1043
    pywikibot/date.py on lines 1096..1102
    pywikibot/date.py on lines 1113..1118
    pywikibot/date.py on lines 1232..1235
    pywikibot/date.py on lines 1342..1344

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

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

            'ro': lambda m: multi(m, [
                (lambda v: dh_constVal(v, 1, 'Secolul I î.Hr.'), lambda p: p == 1),
                (lambda v: dh_centuryBC(v, 'Secolul al %R-lea î.Hr.'),
                 alwaysTrue)]),
    Severity: Major
    Found in pywikibot/date.py and 5 other locations - About 1 hr to fix
    pywikibot/date.py on lines 972..975
    pywikibot/date.py on lines 1040..1043
    pywikibot/date.py on lines 1096..1102
    pywikibot/date.py on lines 1113..1118
    pywikibot/date.py on lines 1342..1344

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

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

            'ur': lambda m: multi(m, [
                (lambda v: dh_constVal(v, 0, '0000مبم'), lambda p: p == 0),
                (lambda v: dh_millenniumAD(v, '%d000مبم'), alwaysTrue)]),
    Severity: Major
    Found in pywikibot/date.py and 5 other locations - About 1 hr to fix
    pywikibot/date.py on lines 972..975
    pywikibot/date.py on lines 1040..1043
    pywikibot/date.py on lines 1096..1102
    pywikibot/date.py on lines 1113..1118
    pywikibot/date.py on lines 1232..1235

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

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

            'ro': lambda m: multi(m, [
                (lambda v: dh_constVal(v, 0, 'Primul deceniu î.Hr.'),
                 lambda p: p == 0),
                (lambda v: dh_decBC(v, 'Anii %d î.Hr.'), alwaysTrue)]),
    Severity: Major
    Found in pywikibot/date.py and 5 other locations - About 1 hr to fix
    pywikibot/date.py on lines 972..975
    pywikibot/date.py on lines 1096..1102
    pywikibot/date.py on lines 1113..1118
    pywikibot/date.py on lines 1232..1235
    pywikibot/date.py on lines 1342..1344

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

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

            'el': lambda m: multi(m, [
                (lambda v: dh_centuryAD(v, '%dός αιώνας'), lambda p: p == 20),
                (lambda v: dh_centuryAD(v, '%dος αιώνας'), alwaysTrue)]),
    Severity: Major
    Found in pywikibot/date.py and 4 other locations - About 1 hr to fix
    pywikibot/date.py on lines 868..870
    pywikibot/date.py on lines 1105..1107
    pywikibot/date.py on lines 1210..1214
    pywikibot/date.py on lines 1294..1297

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

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

            'ca': lambda m: multi(m, [
                (lambda v: dh_decAD(v, 'Dècada de %d'), lambda p: p == 1970),
                (lambda v: dh_decAD(v, 'Dècada del %d'), alwaysTrue)]),
    Severity: Major
    Found in pywikibot/date.py and 4 other locations - About 1 hr to fix
    pywikibot/date.py on lines 1088..1090
    pywikibot/date.py on lines 1105..1107
    pywikibot/date.py on lines 1210..1214
    pywikibot/date.py on lines 1294..1297

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

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

            'fr': lambda m: multi(m, [
                (lambda v: dh_centuryAD(v, '%Rer siècle'), lambda p: p == 1),
                (lambda v: dh_centuryAD(v, '%Re siècle'), alwaysTrue)]),
    Severity: Major
    Found in pywikibot/date.py and 4 other locations - About 1 hr to fix
    pywikibot/date.py on lines 868..870
    pywikibot/date.py on lines 1088..1090
    pywikibot/date.py on lines 1210..1214
    pywikibot/date.py on lines 1294..1297

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

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

            'fr': lambda m: multi(m, [
                (lambda v: dh_centuryBC(v, '%Rer siècle av. J.-C.'),
                 lambda p: p == 1),
                (lambda v: dh_centuryBC(v, '%Re siècle av. J.-C.'),
                 alwaysTrue)]),
    Severity: Major
    Found in pywikibot/date.py and 4 other locations - About 1 hr to fix
    pywikibot/date.py on lines 868..870
    pywikibot/date.py on lines 1088..1090
    pywikibot/date.py on lines 1105..1107
    pywikibot/date.py on lines 1294..1297

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

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

            'fr': lambda m: multi(m, [
                (lambda v: dh_millenniumAD(v, '%Rer millénaire'),
                 lambda p: p == 1),
                (lambda v: dh_millenniumAD(v, '%Re millénaire'), alwaysTrue)]),
    Severity: Major
    Found in pywikibot/date.py and 4 other locations - About 1 hr to fix
    pywikibot/date.py on lines 868..870
    pywikibot/date.py on lines 1088..1090
    pywikibot/date.py on lines 1105..1107
    pywikibot/date.py on lines 1210..1214

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

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

            'sv': lambda v: dh(v, '%d000-talet (millennium)',
                               lambda i: i - 1, lambda ii: ii[0] + 1),
    Severity: Major
    Found in pywikibot/date.py and 4 other locations - About 50 mins to fix
    pywikibot/date.py on lines 1172..1173
    pywikibot/date.py on lines 1242..1243
    pywikibot/date.py on lines 1289..1291
    pywikibot/date.py on lines 1394..1395

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

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

            'sv': lambda v: dh(v, '%d00-talet',
                               lambda i: i - 1, lambda ii: ii[0] + 1),
    Severity: Major
    Found in pywikibot/date.py and 4 other locations - About 50 mins to fix
    pywikibot/date.py on lines 1242..1243
    pywikibot/date.py on lines 1289..1291
    pywikibot/date.py on lines 1339..1340
    pywikibot/date.py on lines 1394..1395

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

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

            'sv': lambda v: dh(v, '%d000-talet f.Kr. (millennium)',
                               lambda i: i - 1, lambda ii: ii[0] + 1),
    Severity: Major
    Found in pywikibot/date.py and 4 other locations - About 50 mins to fix
    pywikibot/date.py on lines 1172..1173
    pywikibot/date.py on lines 1242..1243
    pywikibot/date.py on lines 1289..1291
    pywikibot/date.py on lines 1339..1340

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

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

                (lambda v: dh(v, '%d000-vuosituhat',
                              lambda i: i - 1,
                              lambda ii: ii[0] + 1),
    Severity: Major
    Found in pywikibot/date.py and 4 other locations - About 50 mins to fix
    pywikibot/date.py on lines 1172..1173
    pywikibot/date.py on lines 1242..1243
    pywikibot/date.py on lines 1339..1340
    pywikibot/date.py on lines 1394..1395

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

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

            'sv': lambda v: dh(v, '%d00-talet f.Kr.',
                               lambda i: i - 1, lambda ii: ii[0] + 1),
    Severity: Major
    Found in pywikibot/date.py and 4 other locations - About 50 mins to fix
    pywikibot/date.py on lines 1172..1173
    pywikibot/date.py on lines 1289..1291
    pywikibot/date.py on lines 1339..1340
    pywikibot/date.py on lines 1394..1395

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

    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

    There are no issues that match your filters.

    Category
    Status