Showing 12 of 21 total issues
DataContract
has 31 functions (exceeds 20 allowed). Consider refactoring. Open
class DataContract extends Component implements DataContractInterface
{
/**
* @var array map over model statuses to use by this contract.
*/
File Module.php
has 315 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*
* This file is part of Account.
*
* (c) 2014 Nord Software
Function validateAttribute
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public function validateAttribute($object, $attribute)
{
$password = $object->$attribute;
$length = mb_strlen($password);
if ($this->minLength && $length < $this->minLength) {
- 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 validateAttribute
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function validateAttribute($object, $attribute)
{
$password = $object->$attribute;
$length = mb_strlen($password);
if ($this->minLength && $length < $this->minLength) {
Method initUrlConfig
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function initUrlConfig()
{
if (!isset($this->urlConfig['prefix'])) {
$this->urlConfig['prefix'] = self::URL_PREFIX;
}
Function signup
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function signup()
{
if ($this->validate()) {
$dataContract = Module::getInstance()->getDataContract();
$account = $dataContract->createAccount(['attributes' => $this->attributes]);
- 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 actionConnect
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function actionConnect($providerId)
{
$dataContract = $this->module->getDataContract();
$provider = $dataContract->findProvider($providerId);
- 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
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this method. Open
return true;
Function clientLink
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function clientLink($client, $text = null, array $htmlOptions = [])
{
if ($text === null) {
$text = $client->getTitle();
}
- 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 actionIndex
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function actionIndex()
{
$scenario = $this->module->enableCaptcha ? 'captcha' : 'default';
$dataContract = $this->module->getDataContract();
- 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 actionLogin
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function actionLogin()
{
$dataContract = $this->module->getDataContract();
/** @var LoginForm $model */
- 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"