Showing 599 of 599 total issues

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 457..470
devices/Devices-template.php on lines 515..528
devices/Devices-template.php on lines 529..542
devices/Devices-template.php on lines 543..556
devices/Devices-template.php on lines 557..570
devices/Devices-template.php on lines 571..584
devices/Devices-template.php on lines 585..598
devices/Devices-template.php on lines 599..612

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 457..470
devices/Devices-template.php on lines 501..514
devices/Devices-template.php on lines 515..528
devices/Devices-template.php on lines 529..542
devices/Devices-template.php on lines 543..556
devices/Devices-template.php on lines 557..570
devices/Devices-template.php on lines 585..598
devices/Devices-template.php on lines 599..612

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 457..470
devices/Devices-template.php on lines 501..514
devices/Devices-template.php on lines 515..528
devices/Devices-template.php on lines 529..542
devices/Devices-template.php on lines 543..556
devices/Devices-template.php on lines 557..570
devices/Devices-template.php on lines 571..584
devices/Devices-template.php on lines 585..598

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 457..470
devices/Devices-template.php on lines 501..514
devices/Devices-template.php on lines 529..542
devices/Devices-template.php on lines 543..556
devices/Devices-template.php on lines 557..570
devices/Devices-template.php on lines 571..584
devices/Devices-template.php on lines 585..598
devices/Devices-template.php on lines 599..612

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_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 457..470
devices/Devices-template.php on lines 501..514
devices/Devices-template.php on lines 515..528
devices/Devices-template.php on lines 529..542
devices/Devices-template.php on lines 543..556
devices/Devices-template.php on lines 571..584
devices/Devices-template.php on lines 585..598
devices/Devices-template.php on lines 599..612

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 457..470
devices/Devices-template.php on lines 501..514
devices/Devices-template.php on lines 515..528
devices/Devices-template.php on lines 543..556
devices/Devices-template.php on lines 557..570
devices/Devices-template.php on lines 571..584
devices/Devices-template.php on lines 585..598
devices/Devices-template.php on lines 599..612

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

Consider simplifying this complex logical expression.
Open

        if ($this->selectedEap == \core\common\EAP::EAPTYPE_TLS || $this->selectedEap == \core\common\EAP::EAPTYPE_PEAP_MSCHAP2 || $this->selectedEap == \core\common\EAP::EAPTYPE_PWD || $this->selectedEap == \core\common\EAP::EAPTYPE_TTLS_PAP || $this->selectedEap == \core\common\EAP::EAPTYPE_TTLS_MSCHAP2 || $this->selectedEap == \core\common\EAP::EAPTYPE_SILVERBULLET) {
            $windowsProfile = [];
            $eapConfig = $this->prepareEapConfig($this->attributes);
            $iterator = 0;
            foreach ($allSSID as $ssid => $cipher) {
Severity: Major
Found in devices/ms/DeviceVista7.php - About 40 mins to fix

    Method sendOptionsToDatabase has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        private function sendOptionsToDatabase($object, array $options, array $pendingattributes, string $device = NULL, int $eaptype = NULL) {
    Severity: Minor
    Found in web/lib/admin/OptionParser.php - About 35 mins to fix

      Method processSubmittedFields has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          public function processSubmittedFields($object, array $postArray, array $filesArray, int $eaptype = NULL, string $device = NULL) {
      Severity: Minor
      Found in web/lib/admin/OptionParser.php - About 35 mins to fix

        Method processImage has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            private function processImage($inputImage, $destFile, $width, $height, $resize)
        Severity: Minor
        Found in core/UserAPI.php - About 35 mins to fix

          Method updateCache has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              public function updateCache($device, $path, $mime, $integerEapType, $openRoaming)
          Severity: Minor
          Found in core/ProfileRADIUS.php - About 35 mins to fix

            Method updateCache has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                public function updateCache($device, $path, $mime, $integerEapType, $openRoaming) {
            Severity: Minor
            Found in core/ProfileSilverbullet.php - About 35 mins to fix

              Method newIdP has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  public function newIdP($type, $ownerId, $level, $mail = NULL, $bestnameguess = NULL)
              Severity: Minor
              Found in core/Federation.php - About 35 mins to fix

                Method addAttributeAllLevels has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    private function addAttributeAllLevels($attrName, $attrLang, $attrValue, $eapType, $device)
                Severity: Minor
                Found in core/ProfileRADIUS.php - About 35 mins to fix

                  Method createCArepository has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      private function createCArepository($tmpDir, &$intermOdditiesCAT, $servercert, $eapIntermediates, $eapIntermediateCRLs) {
                  Severity: Minor
                  Found in core/diag/RADIUSTests.php - About 35 mins to fix

                    Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        public function __construct($realm, $outerUsernameForChecks, $supportedEapTypes = [], $expectedServerNames = [], $expectedCABundle = []) {
                    Severity: Minor
                    Found in core/diag/RADIUSTests.php - About 35 mins to fix

                      Method updateCache has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          abstract public function updateCache($device, $path, $mime, $integerEapType, $openRoaming);
                      Severity: Minor
                      Found in core/AbstractProfile.php - About 35 mins to fix

                        Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            def __init__(self, silent: bool = False, username: str = '',
                        Severity: Minor
                        Found in devices/linux/Files/main.py - About 35 mins to fix

                          Method opensslClientsResult has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              private function opensslClientsResult($host, $opensslbabble, &$testresults, $type = '', $resultArrayKey = 0)
                          Severity: Minor
                          Found in core/diag/RFC6614Tests.php - About 35 mins to fix

                            Function innerAuth has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                            Open

                                private function innerAuth($eap)
                                {
                                    $out = [];
                                    $out['EAP'] = 0;
                                    switch ($eap["INNER"]) {
                            Severity: Minor
                            Found in devices/eap_config/DeviceXML.php - About 35 mins 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

                            Severity
                            Category
                            Status
                            Source
                            Language