devices/ms/DeviceVista7.php
Function prepareEapConfig
has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring. Open
Open
private function prepareEapConfig($attr)
{
$outerUser = '';
$vistaExt = '';
$w7Ext = '';
- Read upRead up
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
Open
private function prepareEapConfig($attr)
{
$outerUser = '';
$vistaExt = '';
$w7Ext = '';
File DeviceVista7.php
has 416 lines of code (exceeds 250 allowed). Consider refactoring. Open
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
Function writeInstaller
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
Open
public function writeInstaller()
{
$dom = textdomain(NULL);
textdomain("devices");
// create certificate files and save their names in $caFiles array
- Read upRead up
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
Open
public function writeInstaller()
{
$dom = textdomain(NULL);
textdomain("devices");
// create certificate files and save their names in $caFiles array
Method writeWLANprofile
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
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>
Method writeMainNSH
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function writeMainNSH($eap, $attr) {
$this->loggerInstance->debug(4, "writeMainNSH");
$this->loggerInstance->debug(4, $attr);
$this->loggerInstance->debug(4, "MYLANG=" . $this->lang . "\n");
Method writeWLANprofile
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
private function writeWLANprofile($wlanProfileName, $ssid, $auth, $encryption, $eapConfig, $profileNumber) {
Consider simplifying this complex logical expression. Open
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) {