devices/ms/DeviceVista7.php

Summary

Maintainability
F
3 days
Test Coverage

Function prepareEapConfig has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring.
Open

    private function prepareEapConfig($attr)
    {
        $outerUser = '';
        $vistaExt = '';
        $w7Ext = '';
Severity: Minor
Found in devices/ms/DeviceVista7.php - About 1 day 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 prepareEapConfig has 193 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function prepareEapConfig($attr)
    {
        $outerUser = '';
        $vistaExt = '';
        $w7Ext = '';
Severity: Major
Found in devices/ms/DeviceVista7.php - About 7 hrs to fix

    File DeviceVista7.php has 416 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /*
     * *****************************************************************************
     * Contributions to this work were made on behalf of the GÉANT project, a 
     * project that has received funding from the European Union’s Framework 
    Severity: Minor
    Found in devices/ms/DeviceVista7.php - About 6 hrs to fix

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

          public function writeInstaller()
          {
              $dom = textdomain(NULL);
              textdomain("devices");
              // create certificate files and save their names in $caFiles array
      Severity: Minor
      Found in devices/ms/DeviceVista7.php - About 2 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 51 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function writeInstaller()
          {
              $dom = textdomain(NULL);
              textdomain("devices");
              // create certificate files and save their names in $caFiles array
      Severity: Major
      Found in devices/ms/DeviceVista7.php - About 2 hrs to fix

        Method writeWLANprofile has 50 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private function writeWLANprofile($wlanProfileName, $ssid, $auth, $encryption, $eapConfig, $profileNumber) {
                $profileFileCont = '<?xml version="1.0"?>
        <WLANProfile xmlns="http://www.microsoft.com/networking/WLAN/profile/v1">
        <name>' . $wlanProfileName . '</name>
        <SSIDConfig>
        Severity: Minor
        Found in devices/ms/DeviceVista7.php - About 2 hrs to fix

          Method writeMainNSH has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private function writeMainNSH($eap, $attr) {
                  $this->loggerInstance->debug(4, "writeMainNSH");
                  $this->loggerInstance->debug(4, $attr);
                  $this->loggerInstance->debug(4, "MYLANG=" . $this->lang . "\n");
          
          
          Severity: Minor
          Found in devices/ms/DeviceVista7.php - About 1 hr to fix

            Method writeWLANprofile has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                private function writeWLANprofile($wlanProfileName, $ssid, $auth, $encryption, $eapConfig, $profileNumber) {
            Severity: Minor
            Found in devices/ms/DeviceVista7.php - About 45 mins to fix

              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

                There are no issues that match your filters.

                Category
                Status