devices/Devices-template.php

Summary

Maintainability
F
4 days
Test Coverage

Method listDevices has 504 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function listDevices($profile = 0, $orAlways = 0) {
        \core\common\Entity::intoThePotatoes();
        $lang = new \core\common\Language();
/*      Uncomment lines below if you have button images and want to use them
 * 
Severity: Major
Found in devices/Devices-template.php - About 2 days to fix

    File Devices-template.php has 520 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    /*
     * *****************************************************************************
     * Contributions to this work were made on behalf of the GÉANT project, a 
    Severity: Major
    Found in devices/Devices-template.php - About 1 day to fix

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

                  'android_marshmallow' => [
                      'group' => "android",
                      'display' => _("Android 6.0 Marshmallow"),
                      'match' => 'Android 6',
                      'directory' => 'eap_config',
      Severity: Major
      Found in devices/Devices-template.php and 8 other locations - About 40 mins to fix
      devices/Devices-template.php on lines 443..456
      devices/Devices-template.php on lines 485..498
      devices/Devices-template.php on lines 499..512
      devices/Devices-template.php on lines 513..526
      devices/Devices-template.php on lines 527..540
      devices/Devices-template.php on lines 555..568
      devices/Devices-template.php on lines 569..582
      devices/Devices-template.php on lines 583..596

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

                  'android_kitkat' => [
                      'group' => "android",
                      'display' => _("Android 4.4 KitKat"),
                      'match' => 'Android 4\.[4-9]',
                      'directory' => 'eap_config',
      Severity: Major
      Found in devices/Devices-template.php and 8 other locations - About 40 mins to fix
      devices/Devices-template.php on lines 443..456
      devices/Devices-template.php on lines 485..498
      devices/Devices-template.php on lines 499..512
      devices/Devices-template.php on lines 513..526
      devices/Devices-template.php on lines 527..540
      devices/Devices-template.php on lines 541..554
      devices/Devices-template.php on lines 555..568
      devices/Devices-template.php on lines 583..596

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

                  'android_q' => [
                      'group' => "android",
                      'display' => _("Android 10.0 Q"),
                      'match' => 'Android 10',
                      'directory' => 'eap_config',
      Severity: Major
      Found in devices/Devices-template.php and 8 other locations - About 40 mins to fix
      devices/Devices-template.php on lines 443..456
      devices/Devices-template.php on lines 499..512
      devices/Devices-template.php on lines 513..526
      devices/Devices-template.php on lines 527..540
      devices/Devices-template.php on lines 541..554
      devices/Devices-template.php on lines 555..568
      devices/Devices-template.php on lines 569..582
      devices/Devices-template.php on lines 583..596

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

                  'android_oreo' => [
                      'group' => "android",
                      'display' => _("Android 8.0 Oreo"),
                      'match' => 'Android 8',
                      'directory' => 'eap_config',
      Severity: Major
      Found in devices/Devices-template.php and 8 other locations - About 40 mins to fix
      devices/Devices-template.php on lines 443..456
      devices/Devices-template.php on lines 485..498
      devices/Devices-template.php on lines 499..512
      devices/Devices-template.php on lines 527..540
      devices/Devices-template.php on lines 541..554
      devices/Devices-template.php on lines 555..568
      devices/Devices-template.php on lines 569..582
      devices/Devices-template.php on lines 583..596

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

                  'android_43' => [
                      'group' => "android",
                      'display' => _("Android 4.3"),
                      'match' => 'Android 4\.3',
                      'directory' => 'eap_config',
      Severity: Major
      Found in devices/Devices-template.php and 8 other locations - About 40 mins to fix
      devices/Devices-template.php on lines 443..456
      devices/Devices-template.php on lines 485..498
      devices/Devices-template.php on lines 499..512
      devices/Devices-template.php on lines 513..526
      devices/Devices-template.php on lines 527..540
      devices/Devices-template.php on lines 541..554
      devices/Devices-template.php on lines 555..568
      devices/Devices-template.php on lines 569..582

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

                  'android_lollipop' => [
                      'group' => "android",
                      'display' => _("Android 5.0 Lollipop"),
                      'match' => 'Android 5',
                      'directory' => 'eap_config',
      Severity: Major
      Found in devices/Devices-template.php and 8 other locations - About 40 mins to fix
      devices/Devices-template.php on lines 443..456
      devices/Devices-template.php on lines 485..498
      devices/Devices-template.php on lines 499..512
      devices/Devices-template.php on lines 513..526
      devices/Devices-template.php on lines 527..540
      devices/Devices-template.php on lines 541..554
      devices/Devices-template.php on lines 569..582
      devices/Devices-template.php on lines 583..596

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

                  'android_pie' => [
                      'group' => "android",
                      'display' => _("Android 9.0 Pie"),
                      'match' => 'Android 9',
                      'directory' => 'eap_config',
      Severity: Major
      Found in devices/Devices-template.php and 8 other locations - About 40 mins to fix
      devices/Devices-template.php on lines 443..456
      devices/Devices-template.php on lines 485..498
      devices/Devices-template.php on lines 513..526
      devices/Devices-template.php on lines 527..540
      devices/Devices-template.php on lines 541..554
      devices/Devices-template.php on lines 555..568
      devices/Devices-template.php on lines 569..582
      devices/Devices-template.php on lines 583..596

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

                  'android_nougat' => [
                      'group' => "android",
                      'display' => _("Android 7.0 Nougat"),
                      'match' => 'Android 7',
                      'directory' => 'eap_config',
      Severity: Major
      Found in devices/Devices-template.php and 8 other locations - About 40 mins to fix
      devices/Devices-template.php on lines 443..456
      devices/Devices-template.php on lines 485..498
      devices/Devices-template.php on lines 499..512
      devices/Devices-template.php on lines 513..526
      devices/Devices-template.php on lines 541..554
      devices/Devices-template.php on lines 555..568
      devices/Devices-template.php on lines 569..582
      devices/Devices-template.php on lines 583..596

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

                  'android_8_10' => [
                      'group' => "android",
                      'display' => _("Android 8 to 10"),
                      'match' => 'Android ([89]|10)',
                      'directory' => 'eap_config',
      Severity: Major
      Found in devices/Devices-template.php and 8 other locations - About 40 mins to fix
      devices/Devices-template.php on lines 485..498
      devices/Devices-template.php on lines 499..512
      devices/Devices-template.php on lines 513..526
      devices/Devices-template.php on lines 527..540
      devices/Devices-template.php on lines 541..554
      devices/Devices-template.php on lines 555..568
      devices/Devices-template.php on lines 569..582
      devices/Devices-template.php on lines 583..596

      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

      There are no issues that match your filters.

      Category
      Status