devices/eap_config/DeviceXML.php

Summary

Maintainability
D
2 days
Test Coverage

File DeviceXML.php has 454 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: Minor
Found in devices/eap_config/DeviceXML.php - About 6 hrs to fix

    Function writeInstaller has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
    Open

        public function writeInstaller()
        {
            \core\common\Entity::intoThePotatoes();
            $rootname = 'EAPIdentityProviderList';
            $dom = new \DOMDocument('1.0', 'utf-8');
    Severity: Minor
    Found in devices/eap_config/DeviceXML.php - About 6 hrs 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 writeInstaller has 76 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function writeInstaller()
        {
            \core\common\Entity::intoThePotatoes();
            $rootname = 'EAPIdentityProviderList';
            $dom = new \DOMDocument('1.0', 'utf-8');
    Severity: Major
    Found in devices/eap_config/DeviceXML.php - About 3 hrs to fix

      DeviceXML has 22 functions (exceeds 20 allowed). Consider refactoring.
      Open

      abstract class DeviceXML extends \core\DeviceConfig
      {
          
          /**
           *  @var array $AuthMethodElements is used to limit
      Severity: Minor
      Found in devices/eap_config/DeviceXML.php - About 2 hrs to fix

        Function getDisplayName has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            private function getDisplayName()
            {
                $attr = $this->attributes;
                $objs = [];
                if ($this->langScope === 'global') {
        Severity: Minor
        Found in devices/eap_config/DeviceXML.php - About 1 hr 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 getDisplayName has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private function getDisplayName()
            {
                $attr = $this->attributes;
                $objs = [];
                if ($this->langScope === 'global') {
        Severity: Minor
        Found in devices/eap_config/DeviceXML.php - About 1 hr to fix

          Function getAuthMethodsList has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              private function getAuthMethodsList() {
                  $methodList = [];
                  if ($this->allEaps) {
                      $eapmethods = [];
                      foreach ($this->attributes['all_eaps'] as $eap) {
          Severity: Minor
          Found in devices/eap_config/DeviceXML.php - About 45 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

          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

          There are no issues that match your filters.

          Category
          Status