Showing 714 of 844 total issues
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 prepareExportValue
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function prepareExportValue($data, $mode, $entry_id = null)
{
$modes = (object)$this->getExportModes();
if (isset($data['handle']) && is_array($data['handle']) === false) {
Method prepareExportValue
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function prepareExportValue($data, $mode, $entry_id = null)
{
$modes = (object)$this->getExportModes();
// Make sure we have an array to work with:
Method displaySettingsPanel
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function displaySettingsPanel(XMLElement &$wrapper, $errors = null)
{
parent::displaySettingsPanel($wrapper, $errors);
// Destination Folder
Method resolvePage
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function resolvePage($page_id, $column)
{
$query = (new PageManager)
->select(['p.parent', "p.$column"])
->limit(1);
Method loginFromToken
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function loginFromToken($token)
{
$token = trim($token);
if (strlen($token) === 0) {
Method insertBreadcrumbsUsingPageIdentifier
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function insertBreadcrumbsUsingPageIdentifier($page_id, $preserve_last = true)
{
if ($page_id == 0) {
return $this->insertBreadcrumbs(
array(Widget::Anchor(__('Pages'), SYMPHONY_URL . '/blueprints/pages/'))
Method write
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function write($id, $data)
{
// Only prevent this record from saving if there isn't already a record
// in the database. This prevents empty Sessions from being created, but
// allows them to be nulled.
Function viewSuccess
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected function viewSuccess()
{
$this->Form->setAttribute('action', SYMPHONY_URL);
$h2 = new XMLElement('h2', __('Updating Complete'));
- 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 validate
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function validate()
{
if (strlen(trim($this->_subject)) <= 0) {
throw new EmailValidationException(__('Email subject cannot be empty.'));
} elseif (strlen(trim($this->_sender_email_address)) <= 0) {
- 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 validateSQLQuery
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
final public function validateSQLQuery($query, $strict = true)
{
if (
strpos($query, '\'--') !== false || strpos($query, '\';--') !== false ||
strpos($query, '\' --') !== false || strpos($query, '\'/*') !== false
- 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 10 (exceeds 5 allowed). Consider refactoring. Open
public static function create($name)
{
if (!isset(self::$_pool[$name])) {
$classname = self::__getClassName($name);
$path = self::__getDriverPath($name);
- 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 finalize
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function finalize()
{
// Get a flatten projection
$projection = $this->getSQLParts('projection');
General::flattenArray($projection);
- 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 read
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function read($hash, $namespace = null)
{
$data = false;
$query = $this->Database
->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 prepareExportValue
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function prepareExportValue($data, $mode, $entry_id = null)
{
$modes = (object)$this->getExportModes();
// Export handles:
- 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 10 (exceeds 5 allowed). Consider refactoring. Open
public function displayPublishPanel(XMLElement &$wrapper, $data = null, $flagWithError = null, $fieldnamePrefix = null, $fieldnamePostfix = null, $entry_id = null)
{
if (!$data) {
// TODO: Don't rely on $_POST
if (isset($_POST) && !empty($_POST)) {
- 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 login
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static function login($username, $password, $isHash = false)
{
$username = trim($username);
$password = trim($password);
- 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 sendHeaders
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static function sendHeaders($e)
{
if (!headers_sent()) {
cleanup_session_cookies();
- 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 getPageNamespace
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static function getPageNamespace()
{
if (self::$namespace !== false) {
return self::$namespace;
}
- 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 filter
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function filter(EntryQuery $query, array $filters, $operator = 'or')
{
General::ensureType([
'operator' => ['var' => $operator, 'type' => 'string'],
]);
- 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"