Function delete
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
public static function delete($entries, $section_id = null)
{
$needs_data = true;
if (!is_array($entries)) {
- 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
File class.entrymanager.php
has 344 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* @package toolkit
*/
Method delete
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function delete($entries, $section_id = null)
{
$needs_data = true;
if (!is_array($entries)) {
Function fetch
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public static function fetch($entry_id = null, $section_id = null, $limit = null, $start = null, $where = null, $joins = null, $group = false, $buildentries = true, $element_names = null, $enable_sort = true)
{
if (Symphony::Log()) {
Symphony::Log()->pushDeprecateWarningToLog('EntryManager::fetch()', 'EntryManager::select()');
}
- 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 fetch
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function fetch($entry_id = null, $section_id = null, $limit = null, $start = null, $where = null, $joins = null, $group = false, $buildentries = true, $element_names = null, $enable_sort = true)
{
if (Symphony::Log()) {
Symphony::Log()->pushDeprecateWarningToLog('EntryManager::fetch()', 'EntryManager::select()');
}
Function saveFieldData
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
protected static function saveFieldData($entry_id, $field_id, $field)
{
// Check that we have a field id
if (empty($field_id)) {
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 fetchByPage
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function fetchByPage($page = 1, $section_id, $entriesPerPage, $where = null, $joins = null, $group = false, $records_only = false, $buildentries = true, array $element_names = null)
{
if (Symphony::Log()) {
Symphony::Log()->pushDeprecateWarningToLog(
'EntryManager::fetchByPage()',
Method saveFieldData
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected static function saveFieldData($entry_id, $field_id, $field)
{
// Check that we have a field id
if (empty($field_id)) {
return;
Method fetch
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function fetch($entry_id = null, $section_id = null, $limit = null, $start = null, $where = null, $joins = null, $group = false, $buildentries = true, $element_names = null, $enable_sort = true)
Method fetchByPage
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function fetchByPage($page = 1, $section_id, $entriesPerPage, $where = null, $joins = null, $group = false, $records_only = false, $buildentries = true, array $element_names = null)
Function fetchByPage
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function fetchByPage($page = 1, $section_id, $entriesPerPage, $where = null, $joins = null, $group = false, $records_only = false, $buildentries = true, array $element_names = null)
{
if (Symphony::Log()) {
Symphony::Log()->pushDeprecateWarningToLog(
'EntryManager::fetchByPage()',
- 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 fetchCount
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function fetchCount($section_id = null, $where = null, $joins = null, $group = false)
{
if (Symphony::Log()) {
Symphony::Log()->pushDeprecateWarningToLog('EntryManager::fetchCount()', 'EntryManager::select()->count()');
}
- 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"