File Federation.php
has 421 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*
* *****************************************************************************
* Contributions to this work were made on behalf of the GÉANT project, a
Function downloadStatsCore
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
private function downloadStatsCore($detail = '')
{
if ($detail !== 'ORGANISATIONS' && $detail !== 'PROFILES' && $detail !== 'FEDERATION') {
$detail = 'NONE';
}
- 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 newIdP
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function newIdP($type, $ownerId, $level, $mail = NULL, $bestnameguess = NULL)
{
$this->databaseHandle->exec("INSERT INTO institution (country, type) VALUES('$this->tld', '$type')");
$identifier = $this->databaseHandle->lastID();
Method downloadStatsCore
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function downloadStatsCore($detail = '')
{
if ($detail !== 'ORGANISATIONS' && $detail !== 'PROFILES' && $detail !== 'FEDERATION') {
$detail = 'NONE';
}
Function newIdP
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function newIdP($type, $ownerId, $level, $mail = NULL, $bestnameguess = NULL)
{
$this->databaseHandle->exec("INSERT INTO institution (country, type) VALUES('$this->tld', '$type')");
$identifier = $this->databaseHandle->lastID();
- 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 listIdentityProviders
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function listIdentityProviders($activeOnly = 0)
{
// maybe we did this exercise before?
if ($activeOnly != 0 && count($this->idpListActive) > 0) {
return $this->idpListActive;
Function getIdentityProvidersCertStatus
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function getIdentityProvidersCertStatus() {
$query = "SELECT distinct profile.profile_id FROM profile JOIN profile_option ON profile.profile_id = profile_option.profile_id WHERE option_name='profile:production' AND profile.sufficient_config = 1";
$activeProfiles = [];
$result = $this->databaseHandle->exec($query);
$rows = $result->fetch_all();
- 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 listIdentityProviders
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function listIdentityProviders($activeOnly = 0)
{
// maybe we did this exercise before?
if ($activeOnly != 0 && count($this->idpListActive) > 0) {
return $this->idpListActive;
- 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 listExternalEntities
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function listExternalEntities($unmappedOnly, $type = NULL)
{
$allExternals = [];
$usedarray = [];
$returnarray = [];
- 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 __construct
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct($fedname)
{
// initialise the superclass variables
Method getIdentityProvidersCertStatus
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getIdentityProvidersCertStatus() {
$query = "SELECT distinct profile.profile_id FROM profile JOIN profile_option ON profile.profile_id = profile_option.profile_id WHERE option_name='profile:production' AND profile.sufficient_config = 1";
$activeProfiles = [];
$result = $this->databaseHandle->exec($query);
$rows = $result->fetch_all();
Function downloadStats
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function downloadStats($format, $detail = '')
{
$data = $this->downloadStatsCore($detail);
$retstring = "";
- 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 listExternalEntities
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function listExternalEntities($unmappedOnly, $type = NULL)
{
$allExternals = [];
$usedarray = [];
$returnarray = [];
Method downloadStats
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function downloadStats($format, $detail = '')
{
$data = $this->downloadStatsCore($detail);
$retstring = "";
Method newIdP
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function newIdP($type, $ownerId, $level, $mail = NULL, $bestnameguess = NULL)