Showing 529 of 599 total issues
Method testDatabases
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function testDatabases()
{
$databaseName1 = 'INST';
try {
$db1 = DBConnection::handle($databaseName1);
Method setLang
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function setLang($hardSetLang = 0)
{
// $langConverted will contain candidates for the language setting in the order
// of preference
$loggerInstance = new \core\common\Logging();
Method statusServerCheck
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function statusServerCheck()
{
// request authenticator and other variable content
$reqAuthenticator = random_bytes(16);
$packetIdentifier = random_bytes(1);
Method enumerateOptionsToDisplay
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function enumerateOptionsToDisplay($class, $fed, $device='')
{
$optioninfo = \core\Options::instance();
$loggerInstance = new \core\common\Logging();
$list = $optioninfo->availableOptions($class);
Method writeInstaller
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function writeInstaller()
{
$this->loggerInstance->debug(4, "Chromebook Installer start\n");
$caRefs = [];
// we don't do per-user encrypted containers
Method writeInstaller
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function writeInstaller()
{
\core\common\Entity::intoThePotatoes();
$this->prepareInstallerLang();
$this->setupEapConfig();
Method setGlobalDynamicResult
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function setGlobalDynamicResult()
{
if (isset($this->allReachabilityResults['capath'])) {
foreach ($this->allReachabilityResults['capath'] as $capath) {
$this->globalLevelDynamic = max($this->globalLevelDynamic, $capath->level);
Function __prepare_network_block
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
def __prepare_network_block(ssid: str, user_data: Type[InstallerData]) -> str:
interface = """network={
ssid=\"""" + ssid + """\"
key_mgmt=WPA-EAP
pairwise=CCMP
Method tlsClientSideCheck
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function tlsClientSideCheck(string $host, string $ename, string $realm)
{
$res = RADIUSTests::RETVAL_OK;
if (!is_array(\config\Diagnostics::RADIUSTESTS['TLS-clientcerts']) || count(\config\Diagnostics::RADIUSTESTS['TLS-clientcerts']) == 0) {
return RADIUSTests::RETVAL_SKIPPED;
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 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;
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",
Method listIdentityProvidersWithProfiles
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function listIdentityProvidersWithProfiles() {
$handle = DBConnection::handle("INST");
$handle->exec("SET SESSION group_concat_max_len=10000");
$idpQuery = IdPlist::setAllIdentyProvidersQuery(1);
$allIDPs = $handle->exec($idpQuery);
Method CATInternalTests
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function CATInternalTests()
{
// we are expecting to get a REJECT from all runs, because that means the packet got through to the IdP.
// (the ETLR sometimes does a "Reject instead of Ignore" but that is filtered out and changed into a timeout
// by the test suite automatically, so it does not disturb the measurement)
Function existingIdPInt
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function existingIdPInt($input, $owner = NULL, $claimedFedBinding = NULL)
{
$clean = $this->integer($input);
if ($clean === FALSE) {
throw new Exception($this->inputValidationError("Value for IdP is not an integer!"));
- 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 testGeoip
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
private function testGeoip()
{
$host_4 = '145.0.2.50';
$host_6 = '2001:610:188:444::50';
switch (\config\Master::GEOIP['version']) {
- 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 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 getUserAuthRecords
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function getUserAuthRecords($userId, $testActivity = false) {
// find out all certificate CNs belonging to the user, including expired and revoked ones
$userData = $this->userStatus($userId);
$certNames = [];
foreach ($userData as $oneSlice) {
- 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 findGoodServerLocation
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
private function findGoodServerLocation($adminLocation, $federation, $blacklistedServers)
{
// find a server near him (list of all servers with capacity, ordered by distance)
// first, if there is a pool of servers specifically for this federation, prefer it
// only check the consortium pool group we want to attach to
- 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 getAttributes
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function getAttributes(string $optionName = NULL, string $omittedOptionName = NULL)
{
if ($optionName !== NULL) {
if ($optionName === $omittedOptionName) {
throw new Exception("The attibute to be shown has the same name as that to be omitted");
- 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"