Showing 9 of 21 total issues
File UniLoginTest.php
has 287 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
App::uses('UniLogin', 'UniLoginWebservice.Model');
App::uses('PHPUnitUtil', 'Lib');
class TestUniLogin extends UniLogin {
Function _convertInstitutionList
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
protected function _convertInstitutionList($institutionList) {
$result = false;
if (is_object($institutionList)) {
$property = 'InstitutionSimpel';
if (property_exists($institutionList, $property)) {
- 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 _convertUserList
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
protected function _convertUserList($userList) {
$result = false;
if (is_object($userList)) {
$property = 'PersonSimpel';
if (property_exists($userList, $property)) {
- 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
File UniLogin.php
has 258 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
App::uses('UniLoginWebserviceAppModel', 'UniLoginWebservice.Model');
/**
* UniLogin Model.
Method testConvertInstitutionValid
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testConvertInstitutionValid() {
$institution = new stdClass();
$institution->Instnr = '101001';
$institution->Navn = 'Name of institution.';
$institution->Type = '121';
Method _convertUser
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _convertUser($user, $minimal = false) {
$mapping = [
'uni_login_key' => 'Brugerid',
'full_name' => 'Navn',
'first_name' => 'Fornavn',
Function _convertUser
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
protected function _convertUser($user, $minimal = false) {
$mapping = [
'uni_login_key' => 'Brugerid',
'full_name' => 'Navn',
'first_name' => 'Fornavn',
- 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 _convertInstitution
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _convertInstitution($institution, $minimal = false) {
$mapping = [
'uni_login_key' => 'Instnr',
'name' => 'Navn',
'type' => 'Type',
Function _convertInstitution
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function _convertInstitution($institution, $minimal = false) {
$mapping = [
'uni_login_key' => 'Instnr',
'name' => 'Navn',
'type' => 'Type',
- 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"