Function fetch
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
public static function fetch($id = null, $section_id = null, $order = 'ASC', $sortfield = 'sortorder', $type = null, $location = null, $where = null, $restrict = Field::__FIELD_ALL__)
{
if (Symphony::Log()) {
Symphony::Log()->pushDeprecateWarningToLog('FieldManager::fetch()', 'FieldManager::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
File class.fieldmanager.php
has 343 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* @package toolkit
*/
FieldManager
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
class FieldManager implements FileResource
{
/**
* An array of all the objects that the Manager is responsible for.
* Defaults to an empty array.
Method fetch
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function fetch($id = null, $section_id = null, $order = 'ASC', $sortfield = 'sortorder', $type = null, $location = null, $where = null, $restrict = Field::__FIELD_ALL__)
{
if (Symphony::Log()) {
Symphony::Log()->pushDeprecateWarningToLog('FieldManager::fetch()', 'FieldManager::select()');
}
Function fetchFieldIDFromElementName
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public static function fetchFieldIDFromElementName($element_name, $section_id = null)
{
$schema_sql = Symphony::Database()
->select(['id'])
->from('tbl_fields')
- 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 __getClassPath
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public static function __getClassPath($type)
{
if (is_file(TOOLKIT . "/fields/field.{$type}.php")) {
return TOOLKIT . '/fields';
} else {
- 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 listAll
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public static function listAll()
{
$structure = General::listStructure(TOOLKIT . '/fields', '/field.[a-z0-9_-]+.php/i', false, 'asc', TOOLKIT . '/fields');
$extensions = Symphony::ExtensionManager()->listInstalledHandles();
$types = 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
Method fetchFieldIDFromElementName
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function fetchFieldIDFromElementName($element_name, $section_id = null)
{
$schema_sql = Symphony::Database()
->select(['id'])
->from('tbl_fields')
Method isTextFormatterUsed
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function isTextFormatterUsed($text_formatter_handle)
{
$fields = Symphony::Database()
->select(['type'])
->distinct()
Method fetch
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function fetch($id = null, $section_id = null, $order = 'ASC', $sortfield = 'sortorder', $type = null, $location = null, $where = null, $restrict = Field::__FIELD_ALL__)
Function isTextFormatterUsed
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function isTextFormatterUsed($text_formatter_handle)
{
$fields = Symphony::Database()
->select(['type'])
->distinct()
- 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 create
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function create($type)
{
if (!isset(self::$_pool[$type])) {
$classname = self::__getClassName($type);
$path = self::__getDriverPath($type);
- 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"