File UserAPI.php
has 383 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*
* *****************************************************************************
* Contributions to this work were made on behalf of the GÉANT project, a
UserAPI
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
class UserAPI extends CAT
{
/**
* nothing special to be done here.
Method getLogo
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getLogo($identifier, $type, $widthIn, $heightIn)
{
$expiresString = '';
$attributeName = [
'federation' => "fed:logo_file",
Function generateNewInstaller
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private function generateNewInstaller($device, $profile, $generatedFor, $openRoaming, $token, $password)
{
$this->loggerInstance->debug(5, "generateNewInstaller() - Enter");
$this->loggerInstance->debug(5, "generateNewInstaller:openRoaming:$openRoaming\n");
$factory = new DeviceFactory($device);
- 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 generateNewInstaller
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function generateNewInstaller($device, $profile, $generatedFor, $openRoaming, $token, $password)
{
$this->loggerInstance->debug(5, "generateNewInstaller() - Enter");
$this->loggerInstance->debug(5, "generateNewInstaller:openRoaming:$openRoaming\n");
$factory = new DeviceFactory($device);
Function getLogo
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected function getLogo($identifier, $type, $widthIn, $heightIn)
{
$expiresString = '';
$attributeName = [
'federation' => "fed:logo_file",
- 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 listDevices
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function listDevices($showHidden = 0)
{
$returnList = [];
$count = 0;
if ($showHidden !== 0 && $showHidden != 1) {
- 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 detectOS
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function detectOS()
{
$Dev = \devices\Devices::listDevices();
$devId = $this->deviceFromRequest();
if ($devId !== NULL) {
- 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 generateInstaller
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function generateInstaller($device, $profileId, $generatedFor = "user", $openRoaming = 0, $token = NULL, $password = NULL)
Method downloadInstaller
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function downloadInstaller($device, $prof_id, $generated_for = 'user', $openRoaming = 0, $token = NULL, $password = NULL)
Method generateNewInstaller
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
private function generateNewInstaller($device, $profile, $generatedFor, $openRoaming, $token, $password)
Method processImage
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
private function processImage($inputImage, $destFile, $width, $height, $resize)
Function testForResize
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function testForResize($width, $height)
{
if (is_numeric($width) && is_numeric($height) && ($width > 0 || $height > 0)) {
if ($height == 0) {
$height = 10000;
- 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 generateInstaller
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function generateInstaller($device, $profileId, $generatedFor = "user", $openRoaming = 0, $token = NULL, $password = NULL)
{
$this->loggerInstance->debug(4, "generateInstaller arguments:$device:$profileId:$openRoaming\n");
$validator = new \web\lib\common\InputValidation();
$profile = $validator->existingProfile($profileId);
- 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 profileAttributes
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function profileAttributes($profId)
{
$validator = new \web\lib\common\InputValidation();
$profile = $validator->existingProfile($profId);
$attribs = $profile->getCollapsedAttributes();
- 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"