Showing 13 of 25 total issues
Method init
has 167 lines of code (exceeds 25 allowed). Consider refactoring. Open
function init()
{
$this->_a['table'] = 'cms_contents';
$this->_a['cols'] = array(
// Identifier
Method init
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
function init()
{
$this->_a['table'] = 'cms_content_histories';
$this->_a['verbose'] = 'CMS Content History';
$this->_a['cols'] = array(
Method init
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
function init()
{
$this->_a['table'] = 'cms_term_taxonomy';
$this->_a['verbose'] = 'CMS_TermTaxonomy';
$this->_a['cols'] = array(
File content.php
has 268 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*
* This file is part of Pluf Framework, a simple PHP Application Framework.
* Copyright (C) 2010-2020 Phoinex Scholars Co. (http://dpq.co.ir)
*
Method find
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function find($request, $match)
{
if (isset($match['name'])) {
$content = CMS_Shortcuts_GetNamedContentOr404($match['name']);
} else {
Method init
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function init()
{
$this->_a['table'] = 'cms_term_metas';
$this->_a['cols'] = array(
// Identifier
Method init
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
function init()
{
$this->_a['table'] = 'cms_content_metas';
$this->_a['cols'] = array(
// Identifier
Function save
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function save($commit = true)
{
$model = parent::save(false);
// update the content
if (array_key_exists('file', $this->cleaned_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 addContent
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function addContent($request, $match)
{
$tt = Pluf_Shortcuts_GetObjectOr404('CMS_TermTaxonomy', $match['parentId']);
$content = NULL;
if (array_key_exists('modelId', $match)) {
- 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 removeContent
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function removeContent($request, $match)
{
$tt = Pluf_Shortcuts_GetObjectOr404('CMS_TermTaxonomy', $match['parentId']);
$content = NULL;
if (array_key_exists('modelId', $match)) {
- 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 addTermTaxonomy
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function addTermTaxonomy($request, $match)
{
$content = Pluf_Shortcuts_GetObjectOr404('CMS_Content', $match['parentId']);
$tt = NULL;
if (array_key_exists('modelId', $match)) {
- 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 removeTermTaxonomy
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function removeTermTaxonomy($request, $match)
{
$content = Pluf_Shortcuts_GetObjectOr404('CMS_Content', $match['parentId']);
$tt = NULL;
if (array_key_exists('modelId', $match)) {
- 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 preSave
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function preSave($create = false)
{
if($this->_internal){
// this function do nothing in the internal state.
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"