File MobileconfigSuperclass.php
has 531 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*
* *****************************************************************************
* Contributions to this work were made on behalf of the GÉANT project, a
Method networkBlock
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function networkBlock($blocktype, $toBeConfigured, $prettyName)
{
\core\common\Entity::intoThePotatoes();
$eapType = $this->selectedEap;
switch ($blocktype) {
Method eapBlock
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function eapBlock($eapType)
{
$realm = $this->determineOuterIdString();
$retval = "<key>EAPClientConfiguration</key>
<dict>
Method writeInstaller
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function writeInstaller()
{
\core\common\Entity::intoThePotatoes();
$this->loggerInstance->debug(4, "mobileconfig Module Installer start\n");
Method caBlob
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function caBlob($ca)
{
\core\common\Entity::intoThePotatoes();
$stream = "";
if (!in_array($ca['uuid'], $this->CAsAccountedFor)) { // skip if this is a duplicate
Function allNetworkBlocks
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private function allNetworkBlocks()
{
$retval = "";
$this->serial = 0;
$this->loggerInstance->debug(3, $this->attributes['internal:networks'], "NETWORKS:\n", "\n");
- 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 networkBlock
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private function networkBlock($blocktype, $toBeConfigured, $prettyName)
{
\core\common\Entity::intoThePotatoes();
$eapType = $this->selectedEap;
switch ($blocktype) {
- 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 clientP12Block
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function clientP12Block()
{
\core\common\Entity::intoThePotatoes();
if (count($this->clientCert) == 0) {
throw new Exception("the client block was called but there is no client certificate!");
Method removenetworkBlock
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function removenetworkBlock($ssid)
{
\core\common\Entity::intoThePotatoes();
$retval = "
<dict>
Method writeDeviceInfo
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function writeDeviceInfo()
{
\core\common\Entity::intoThePotatoes();
$ssidCount = 0;
$oiCount = 0;
Function consentBlock
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function consentBlock()
{
\core\common\Entity::intoThePotatoes();
if (isset($this->attributes['support:info_file'])) {
return MobileconfigSuperclass::BUFFER_CONSENT_PRE . htmlspecialchars(iconv("UTF-8", "UTF-8//TRANSLIT", $this->attributes['support:info_file'][0]), ENT_XML1, 'UTF-8') . MobileconfigSuperclass::BUFFER_CONSENT_POST;
- 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
Avoid too many return
statements within this method. Open
return "";
Function eapBlock
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function eapBlock($eapType)
{
$realm = $this->determineOuterIdString();
$retval = "<key>EAPClientConfiguration</key>
<dict>
- 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"