File DeviceConfig.php
has 436 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*
* *****************************************************************************
* Contributions to this work were made on behalf of the GÉANT project, a
DeviceConfig
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class DeviceConfig extends \core\common\Entity
{
/**
* stores the path to the temporary working directory for a module instance
Function getNetworks
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
private function getNetworks()
{
$additionalConsortia = [];
$additionalSSIDs = [];
$ssids = $this->getConfigSSIDs();
- 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 setup
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
final public function setup(AbstractProfile $profile, $token = NULL, $importPassword = NULL, $openRoaming = 0)
{
$this->loggerInstance->debug(4, "module setup start\n");
common\Entity::intoThePotatoes();
$purpose = 'installer';
Function setup
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
final public function setup(AbstractProfile $profile, $token = NULL, $importPassword = NULL, $openRoaming = 0)
{
$this->loggerInstance->debug(4, "module setup start\n");
common\Entity::intoThePotatoes();
$purpose = 'installer';
- 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
Function longestNameSuffix
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function longestNameSuffix()
{
// for all configured server names, find the string that is the longest
// suffix to all of them
$longestSuffix = "";
- 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 saveCertificateFiles
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
final protected function saveCertificateFiles($format)
{
switch ($format) {
case "der": // fall-thorugh, same treatment
case "pem":
Method getNetworks
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getNetworks()
{
$additionalConsortia = [];
$additionalSSIDs = [];
$ssids = $this->getConfigSSIDs();
Function getSSIDs
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function getSSIDs()
{
$ssidList = [];
$ssidList['add'] = [];
$ssidList['del'] = [];
- 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
Function getInstallerBasename
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function getInstallerBasename()
{
$baseName = $this->customTranslit(\config\ConfAssistant::CONSORTIUM['name'])."-".$this->getDeviceId();
if (isset($this->attributes['profile:customsuffix'][1])) {
// this string will end up as a filename on a filesystem, so always
- 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
Function saveCertificateFiles
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
final protected function saveCertificateFiles($format)
{
switch ($format) {
case "der": // fall-thorugh, same treatment
case "pem":
- 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
Function getConsortia
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function getConsortia()
{
if (!isset(\config\ConfAssistant::CONSORTIUM['interworking-consortium-oi'])) {
return ([]);
- 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
Function saveLogoFile
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function saveLogoFile($logos, $type)
{
$iterator = 0;
$returnarray = [];
foreach ($logos as $blob) {
- 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"