Showing 63 of 816 total issues
Function run
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function run()
{
$model = new SetUpForm(['user' => Yii::$app->user->identity]);
if ($model->load(Yii::$app->request->post())) {
try {
- 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 user
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function user($user)
{
$model = $this->noInitModel;
/* @var $model Member */
if (!is_string($model->memberAttribute) || empty($model->memberAttribute)) {
- 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 Yii::$app->authManager->checkAccess($this->operator->getGUID(), (new ManageMember)->name, ['organization' => $model->organization]);
Avoid too many return
statements within this method. Open
return $this->controller->redirect(['member', 'org' => $org]);
Avoid too many return
statements within this method. Open
return true;
Avoid too many return
statements within this method. Open
return $result;
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this method. Open
return Url::to(['settings', 'id' => $model->getID()]);
Avoid too many return
statements within this method. Open
return Url::to(['exit', 'id' => $model->getID()]);
Avoid too many return
statements within this method. Open
return '#';
Avoid too many return
statements within this method. Open
return Url::to(['update', 'id' => $model->getID()]);
Avoid too many return
statements within this method. Open
return Yii::$app->authManager->checkAccess($this->operator->getGUID(), $permission, ['organization' => $model]);
Avoid too many return
statements within this method. Open
return Url::to(['revoke', 'id' => $model->getID()]);
Function assignAdministrator
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function assignAdministrator()
{
$host = $this->organization;
/* @var $host Organization */
if ($this->isCreator()) {
- 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 revokeAdministrator
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function revokeAdministrator()
{
$host = $this->organization;
/* @var $host Organization */
if ($this->isCreator()) {
- 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 removeAdministrator
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function removeAdministrator(&$member, $keep = true)
{
if ($this->getIsNewRecord()) {
return false;
}
- 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 run
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function run($org, $user, $revoke = '0')
{
$organization = Module::getOrganization($org);
static::checkAccess($organization, Yii::$app->user->identity);
- 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 initMessages
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function initMessages()
{
if (!is_string($this->joinSuccessMessage) || empty($this->joinSuccessMessage)) {
$this->joinSuccessMessage = Yii::t('organization', 'Joined.');
}
- 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 execute
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function execute($user, $item, $params)
{
$class = Yii::$app->user->identityClass;
if (is_numeric($user) || is_int($user)) {
$user = $class::find()->id($user)->one();
- 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 setUpBaseOrganization
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function setUpBaseOrganization($models)
{
$model = null;
$associatedModels = [];
if (is_array($models)) {
- 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"