wikimedia/mediawiki-core

View on GitHub
includes/languages/LanguageKk_cyrl.php

Summary

Maintainability
F
5 days
Test Coverage

Function convertGrammarKk_cyrl has a Cognitive Complexity of 108 (exceeds 5 allowed). Consider refactoring.
Open

    protected function convertGrammarKk_cyrl( $word, $case ) {
        $grammarForms =
            MediaWikiServices::getInstance()->getMainConfig()->get( MainConfigNames::GrammarForms );
        if ( isset( $grammarForms['kk-kz'][$case][$word] ) ) {
            return $grammarForms['kk-kz'][$case][$word];
Severity: Minor
Found in includes/languages/LanguageKk_cyrl.php - About 2 days to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method convertGrammarKk_cyrl has 218 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function convertGrammarKk_cyrl( $word, $case ) {
        $grammarForms =
            MediaWikiServices::getInstance()->getMainConfig()->get( MainConfigNames::GrammarForms );
        if ( isset( $grammarForms['kk-kz'][$case][$word] ) ) {
            return $grammarForms['kk-kz'][$case][$word];
Severity: Major
Found in includes/languages/LanguageKk_cyrl.php - About 1 day to fix

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

                case "accusative": # tabıs
                    if ( in_array( $wordEnding, $Consonants ) ) {
                        if ( in_array( $wordLastVowel, $frontVowels ) ) {
                            $word .= "ті";
                        } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
    Severity: Major
    Found in includes/languages/LanguageKk_cyrl.php and 1 other location - About 4 hrs to fix
    includes/languages/LanguageKk_cyrl.php on lines 113..133

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

    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

                case "possessive dative": # täweldık + barıs
                    if ( in_array( $wordEnding, $firstPerson ) ) {
                        if ( in_array( $wordLastVowel, $frontVowels ) ) {
                            $word .= "е";
                        } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
    Severity: Major
    Found in includes/languages/LanguageKk_cyrl.php and 1 other location - About 4 hrs to fix
    includes/languages/LanguageKk_cyrl.php on lines 136..156

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

    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

                case "locative": # jatıs
                    if ( in_array( $wordEnding, $Consonants ) ) {
                        if ( in_array( $wordLastVowel, $frontVowels ) ) {
                            $word .= "те";
                        } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
    Severity: Major
    Found in includes/languages/LanguageKk_cyrl.php and 1 other location - About 2 hrs to fix
    includes/languages/LanguageKk_cyrl.php on lines 96..110

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

    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

                case "possessive locative": # täweldık + jatıs
                    if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $secondPerson ) ) {
                        if ( in_array( $wordLastVowel, $frontVowels ) ) {
                            $word .= "де";
                        } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
    Severity: Major
    Found in includes/languages/LanguageKk_cyrl.php and 1 other location - About 2 hrs to fix
    includes/languages/LanguageKk_cyrl.php on lines 232..246

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

    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

                case "possessive ablative": # täweldık + şığıs
                    if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $thirdPerson ) ) {
                        if ( in_array( $wordLastVowel, $frontVowels ) ) {
                            $word .= "нен";
                        } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
    Severity: Major
    Found in includes/languages/LanguageKk_cyrl.php and 1 other location - About 2 hrs to fix
    includes/languages/LanguageKk_cyrl.php on lines 189..203

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

    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

                case "dative": # barıs
                    if ( in_array( $wordEnding, $Consonants ) ) {
                        if ( in_array( $wordLastVowel, $frontVowels ) ) {
                            $word .= "ке";
                        } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
    Severity: Major
    Found in includes/languages/LanguageKk_cyrl.php and 1 other location - About 2 hrs to fix
    includes/languages/LanguageKk_cyrl.php on lines 172..186

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

    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

                case "possessive comitative": # täweldık + kömektes
                    if ( in_array( $wordEnding, $Consonants ) ) {
                            $word .= "пенен";
                    } elseif ( in_array( $wordEnding, $allVowels )
                        || in_array( $wordEnding, $Nasals )
    Severity: Minor
    Found in includes/languages/LanguageKk_cyrl.php and 1 other location - About 50 mins to fix
    includes/languages/LanguageKk_cyrl.php on lines 249..260

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

    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

                case "comitative": # kömektes
                    if ( in_array( $wordEnding, $Consonants ) ) {
                            $word .= "пен";
                    } elseif ( in_array( $wordEnding, $allVowels )
                        || in_array( $wordEnding, $Nasals )
    Severity: Minor
    Found in includes/languages/LanguageKk_cyrl.php and 1 other location - About 50 mins to fix
    includes/languages/LanguageKk_cyrl.php on lines 262..273

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

    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