Showing 209 of 326 total issues
Function controller
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
controller : ['$scope', '$http', function($scope, $http) {
$scope.modules = [];
$scope.controllers = [];
$scope.actions = [];
Method testRegisterCssAndJs
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testRegisterCssAndJs()
{
// Simulate already registered js
Yii::$app->view->js = [
View::POS_READY => [
Method testNavItemForPageVersions
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testNavItemForPageVersions()
{
$navItemFixture = $this->createCmsNavItemFixture([
1 => [
'id' => 1,
Method testActionDeepPageCopyAsTemplateError
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testActionDeepPageCopyAsTemplateError()
{
// erroring
PermissionScope::run($this->app, function (PermissionScope $scope) {
$this->createAdminLangFixture();
Method testFindWebsiteContainer
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testFindWebsiteContainer()
{
PageScope::run($this->app, function (PageScope $scope) {
$this->createAdminGroupFixture(1);
$this->createAdminUserFixture();
Function rules
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function rules()
{
return [
[['json_config_values', 'json_config_cfg_values'], function ($attribute, $params) {
// if its not an array, the attribute is not dirty and has not to be serialized from input.
- 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 imageArrayUpload
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public static function imageArrayUpload(string|int|null|array $value, bool|string $applyFilter = false, $returnObject = false)
{
if (!empty($value) && is_array($value)) {
$data = [];
- 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 findOneByHostName
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function findOneByHostName($hostName): array|bool
{
$cache = $this->getHasCache($hostName);
if ($cache) {
return $cache;
- 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 createPageFromDraft
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function createPageFromDraft($parentNavId, $navContainerId, $langId, $title, $alias, $description, $fromDraftNavId, $isDraft = false): bool|array
{
if (!$isDraft && empty($isDraft) && !is_numeric($isDraft)) {
$isDraft = 0;
}
- 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 actionSaveProperties
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function actionSaveProperties($navId)
{
$rows = [];
$doNotDeleteList = [];
- 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 11 (exceeds 5 allowed). Consider refactoring. Open
public function run()
{
// when the setup timestamp is not yet set, its a fresh installation, therefore skip the 1.0.0 generic block upgrade
// otherwise its an existing/upgrading instance which is doing the import command.
if (!Config::has(Config::CONFIG_SETUP_COMMAND_TIMESTAMP)) {
- 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 createRedirect
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
public function createRedirect($parentNavId, $navContainerId, $langId, $title, $alias, $redirectType, $redirectTypeValue, $description, $redirectTypeTarget, $anchor = null): array|int
Function getContentAsArray
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function getContentAsArray()
{
//$nav_item_page = (new \yii\db\Query())->select('*')->from('cms_nav_item_page t1')->leftJoin('cms_layout', 'cms_layout.id=t1.layout_id')->where(['t1.id' => $this->id])->one();
$nav_item_page = $this;
- 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 createModule
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
public function createModule($parentNavId, $navContainerId, $langId, $title, $alias, $moduleName, $description, $controllerName, $actionName, array $actionParams): array|int
Function getKeywords
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function getKeywords()
{
if ($this->_keywords === null) {
if (empty($this->itemArray['keywords'])) {
$this->_keywords = [];
- 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 ensureInputValues
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function ensureInputValues($event)
{
// sort index fixture
if (!$this->isNewRecord) {
Method getRowDescriber
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getRowDescriber()
{
if (!empty($this->row_id)) {
switch (StorageFile::cleanBaseTableName($this->table_name)) {
case "cms_nav":
Method testImportLayoutAndChangeAfterwardsIssue337
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testImportLayoutAndChangeAfterwardsIssue337()
{
$this->createCmsLayoutFixture();
$controller = new ImportController('import-controller', $this->app);
$importer = new CmslayoutImporter($controller, $this->app->getModule('cmsadmin'));
Method getConfigArray
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getConfigArray()
{
return [
'id' => 'basetestcase',
'basePath' => dirname(__DIR__),
Method actionIndex
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function actionIndex($itemId, $version = false, $date = false): \yii\web\Response|string
{
if (Yii::$app->adminuser->isGuest) {
throw new ForbiddenHttpException('Unable to see the preview page, session expired or not logged in.');
}