Method defineLabels
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function defineLabels($ctn, $hierarchical = false)
{
$labels = array(
'name' => $ctn['name'],
'singular_name' => isset($ctn['singular_name']) && !empty($ctn['singular_name'])
Method setTerms
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function setTerms($terms)
{
$this->terms = $terms;
//Add WP Hooks
Consider simplifying this complex logical expression. Open
if ($hierarchical) {
$labels['parent_item'] = isset($ctn['parent_item']) && !empty($ctn['parent_item'])
? $ctn['parent_item']
: OlympusZeus::translate('Parent item');
$labels['parent_item_colon'] = isset($ctn['parent_item_colon']) && !empty($ctn['parent_item_colon'])
Method hookFieldsSave
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function hookFieldsSave($term_id)
{
//Admin panel
if (!OLZ_ISADMIN) {
return;
Function hookFieldsSave
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function hookFieldsSave($term_id)
{
//Admin panel
if (!OLZ_ISADMIN) {
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
Method hookFieldsDisplay
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function hookFieldsDisplay($term)
{
//Definitions
$contents = array();
$ids = array();
Function hookFieldsDisplay
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function hookFieldsDisplay($term)
{
//Definitions
$contents = array();
$ids = array();
- 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;
Avoid too many return
statements within this method. Open
return;
Avoid too many return
statements within this method. Open
return;
Function registerTerm
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function registerTerm($term = array())
{
//Check post types
if (empty($term)) {
return array();
- 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"