Showing 63 of 816 total issues
Method revokeRole
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function revokeRole($role)
{
$user = $this->memberUser;
if (!$user) {
throw new InvalidValueException('Invalid User');
Method initVisibleButtons
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function initVisibleButtons()
{
if (!empty($this->visibleButtons)) {
return;
}
Method revokeAdministrator
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function revokeAdministrator()
{
$host = $this->organization;
/* @var $host Organization */
if ($this->isCreator()) {
Method run
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function run($org)
{
$organization = Module::getOrganization($org);
$user = Yii::$app->user->identity;
static::checkAccess($organization, $user);
Method run
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function run($id)
{
$organization = Module::getOrganization($id);
$user = Yii::$app->user->identity;
static::checkAccess($organization, $user);
Method assignAdministrator
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function assignAdministrator()
{
$host = $this->organization;
/* @var $host Organization */
if ($this->isCreator()) {
Method initDefaultButtons
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function initDefaultButtons()
{
$this->initDefaultButton('view', false);
$this->initDefaultButton('member', false, [
'title' => Yii::t('organization', 'Member'),
Method createBaseOrganization
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
protected function createBaseOrganization($name, $parent = null, $nickname = '', $gravatar_type = 0, $gravatar = '', $timezone = 'UTC', $description = '', $type = Organization::TYPE_ORGANIZATION)
Function run
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function run($parent)
{
$model = new SetUpForm(['user' => Yii::$app->user->identity, 'parent' => $parent]);
if (!$model->getParent()) {
throw new BadRequestHttpException(Yii::t('organization', 'Parent Organization/Department Not Exist.'));
- 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 createOrganization
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public function createOrganization($name, $parent = null, $nickname = '', $gravatar_type = 0, $gravatar = '', $timezone = 'UTC', $description = '')
Method createDepartment
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public function createDepartment($name, $parent = null, $nickname = '', $gravatar_type = 0, $gravatar = '', $timezone = 'UTC', $description = '')
Method setUpDepartment
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public function setUpDepartment($name, $parent, $nickname = '', $gravatar_type = 0, $gravatar = '', $timezone = 'UTC', $description = '')
Function run
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function run($parent)
{
$model = new SetUpForm(['user' => Yii::$app->user->identity, 'parent' => $parent]);
if (!$model->getParent()) {
throw new BadRequestHttpException(Yii::t('organization', 'Parent Organization/Department Not Exist.'));
- 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 8 (exceeds 5 allowed). Consider refactoring. Open
public function run($id)
{
$organization = Module::getOrganization($id);
$user = Yii::$app->user->identity;
static::checkAccess($organization, $user);
- 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 8 (exceeds 5 allowed). Consider refactoring. Open
public function run()
{
$user = Yii::$app->user->identity;
if ($user->hasReachedOrganizationLimit()) {
throw new NumberOfOrganizationsExceededException();
- 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 revokeOrganization
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function revokeOrganization($organization, $revokeIfHasChildren = true)
{
if (!($organization instanceof $this->organizationClass))
{
$class = $this->organizationClass;
- 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 initUrlCreator
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function initUrlCreator()
{
if (isset($this->urlCreator)) {
return;
}
- 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 actionJoin
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function actionJoin($entrance)
{
$organization = static::getOrganization($entrance);
$user = Yii::$app->user->identity;
if ($organization->creator->equals($user)) {
- 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 setUpOrganization
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function setUpOrganization($name, $nickname = '', $gravatar_type = 0, $gravatar = '', $timezone = 'UTC', $description = '')
Function revokeRole
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function revokeRole($role)
{
$user = $this->memberUser;
if (!$user) {
throw new InvalidValueException('Invalid User');
- 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"