Showing 714 of 844 total issues
Function getAssociationContext
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function getAssociationContext()
{
$context = Symphony::Engine()->Page->getContext();
$associations = $context['associations']['parent'];
$field_association = 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 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)
Function appendValues
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
final protected function appendValues(array $values)
{
if ($this->isUsingPlaceholders()) {
$values = array_values($values);
} 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 buildDSRetrievalSQL
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function buildDSRetrievalSQL($data, &$joins, &$where, $andOperation = false)
{
if (Symphony::Log()) {
Symphony::Log()->pushDeprecateWarningToLog(
get_called_class() . '::buildDSRetrievalSQL()',
- 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 displayPublishPanel
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function displayPublishPanel(XMLElement &$wrapper, $data = null, $flagWithError = null, $fieldnamePrefix = null, $fieldnamePostfix = null, $entry_id = null)
{
if (is_dir(DOCROOT . $this->get('destination') . '/') === false) {
$flagWithError = __('The destination directory, %s, does not exist.', array(
'<code>' . $this->get('destination') . '</code>'
- 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 appendErrors
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public static function appendErrors(XMLElement $result, array $fields, $errors, $post_values)
{
$result->setAttribute('result', 'error');
$result->appendChild(new XMLElement('message', __('Entry encountered errors when saving.'), array(
'message-id' => EventMessages::ENTRY_ERRORS
- 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 displayPublishPanel
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function displayPublishPanel(XMLElement &$wrapper, $data = null, $flagWithError = null, $fieldnamePrefix = null, $fieldnamePostfix = null, $entry_id = null)
{
$value = null;
if (isset($data['value'])) {
- 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 serializeArray
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
protected function serializeArray(array $arr, $indentation = 0, $tab = self::TAB)
{
$tabs = '';
$closeTabs = '';
for ($i = 0; $i < $indentation; $i++) {
- 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 hash
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public static function hash($input, array $options = [])
{
if (empty($options['salt'])) {
$salt = self::generateSalt(self::SALT_LENGTH);
} 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 setSettings
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public static function setSettings(array $settings = array())
{
// Date format
if (isset($settings['date_format'])) {
self::$settings['date_format'] = $settings['date_format'];
- 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 view
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function view()
{
$sort = General::sanitize($_REQUEST['sort']);
$sections = (new SectionManager)
->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
Function order
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
$(document).on('mousemove.orderable', '.orderable:has(.ordering)', function order(event) {
var object = $(this);
if (object.data('ordering') != 1) {
return;
}
Method __process
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function __process(XSLTProcessor $XSLProc, $xml, $xsl, array $parameters = array())
{
// Create instances of the DOMDocument class
$xmlDoc = new DOMDocument;
$xslDoc = new DOMDocument;
Method createSectionAssociation
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function createSectionAssociation($parent_section_id = null, $child_field_id = null, $parent_field_id = null, $show_association = true, $interface = null, $editor = null)
{
if (is_null($parent_section_id) && (is_null($parent_field_id) || !$parent_field_id)) {
return false;
}
Function attachMessage
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
objects.on('attach.notify', function attachMessage(event, message, type) {
var object = $(this),
notifier = object.find('div.notifier'),
items = notifier.find(settings.items),
item, storage;
Method setDataFromPost
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function setDataFromPost($data, &$errors = null, $simulate = false, $ignore_missing_fields = false)
{
$status = Entry::__ENTRY_OK__;
// Entry has no ID, create it:
Function pick
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
objects.on('change.pickable', function pick() {
var object = $(this),
choice = object.val(),
relation = object.attr('id') || object.attr('name'),
related = $(settings.pickables + '[data-relation="' + relation + '"]'),
Method fetchFilterableOperators
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function fetchFilterableOperators()
{
return array(
array(
'title' => 'is',
Method createHandle
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function createHandle($string, $max_length = 255, $delim = '-', $uriencode = false, $additional_rule_set = null)
{
// If empty, bail out quick
if (empty(trim($string))) {
return '';
Method fetch
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function fetch($sortby = 'id', $sortdirection = 'ASC', $limit = null, $start = null, $where = null, $joins = null)
{
if (Symphony::Log()) {
Symphony::Log()->pushDeprecateWarningToLog('AuthorManager::fetch()', 'AuthorManager::select()');
}