Showing 599 of 599 total issues
AbstractProfile
has 29 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class AbstractProfile extends EntityWithDBProperties
{
const HIDDEN = -1;
const AVAILABLE = 0;
File IdP.php
has 311 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*
* *****************************************************************************
* Contributions to this work were made on behalf of the GÉANT project, a
File Telepath.php
has 311 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 sanitiseInputs
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function sanitiseInputs(array $listOfEntries) {
$retval = [];
$bad = [];
$multilangAttrsWithC = [];
foreach ($listOfEntries as $objId => $objValueRaw) {
RADIUSTests
has 28 functions (exceeds 20 allowed). Consider refactoring. Open
class RADIUSTests extends AbstractTest {
/**
* Was the reachability check executed already?
*
File OutsideComm.php
has 305 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) {
File CertificationAuthorityEduPki.php
has 303 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*
* ******************************************************************************
* Copyright 2011-2017 DANTE Ltd. and GÉANT on behalf of the GN3, GN3+, GN4-1
Function deleteObsoleteTempDirs
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
public static function deleteObsoleteTempDirs() {
$downloadsDirs = [
'site_installers' => dirname(dirname(dirname(dirname(__FILE__)))) . "/var/installer_cache",
'silverbullet' => dirname(dirname(dirname(dirname(__FILE__)))) . "/var/silverbullet"
];
- 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 mailAddressValidSecure
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
public static function mailAddressValidSecure($address)
{
$loggerInstance = new \core\common\Logging();
if (!filter_var($address, FILTER_VALIDATE_EMAIL)) {
$loggerInstance->debug(4, "OutsideComm::mailAddressValidSecure: invalid mail address.");
- 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 adminInvitationMail
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
public static function adminInvitationMail($targets, $introtext, $newtoken, $idpPrettyName, $federation, $type)
{
if (!in_array($introtext, OutsideComm::INVITE_CONTEXTS)) {
throw new \Exception("Unknown invite mode!");
}
- 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 extractIncomingCertsfromEAP
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
private function extractIncomingCertsfromEAP(&$testresults, $tmpDir) {
/*
* EAP's house rules:
* 1) it is unnecessary to include the root CA itself (adding it has
* detrimental effects on performance)
- 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 marshalObject
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function marshalObject($domElement, $node, $name, $object, $namespace = NULL, $root = false)
{
if (is_null($object)) {
return;
}
InputValidation
has 27 functions (exceeds 20 allowed). Consider refactoring. Open
class InputValidation extends \core\common\Entity
{
/**
* returns a simple HTML <p> element with basic explanations about what was
Function enumerateOptionsToDisplay
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public static function enumerateOptionsToDisplay($class, $fed, $device='')
{
$optioninfo = \core\Options::instance();
$loggerInstance = new \core\common\Logging();
$list = $optioninfo->availableOptions($class);
- 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 testDefaults
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
private function testDefaults()
{
$defaultvalues = "";
$missingvalues = "";
// all the checks for equality with a shipped default value
- 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 propertyCheckServercert
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
private function propertyCheckServercert(&$servercert) {
// we share the same checks as for CAs when it comes to signature algorithm and basicconstraints
// so call that function and memorise the outcome
$returnarray = $this->propertyCheckIntermediate($servercert, TRUE);
$sANdns = [];
- 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
Similar blocks of code found in 2 locations. Consider refactoring. Open
public function writeLANprofile()
{
$rootname = 'LANProfile';
$dom = new \DOMDocument('1.0', 'utf-8');
$root = $dom->createElement($rootname);
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 143.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
public function writeWLANprofile()
{
$rootname = 'WLANProfile';
$dom = new \DOMDocument('1.0', 'utf-8');
$root = $dom->createElement($rootname);
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 143.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Method writeInstaller
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function writeInstaller()
{
\core\common\Entity::intoThePotatoes();
$rootname = 'EAPIdentityProviderList';
$dom = new \DOMDocument('1.0', 'utf-8');