Showing 714 of 844 total issues
Method addTimestampValidationPageAlert
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function addTimestampValidationPageAlert($errorMessage, $existingObject, $action)
{
$authorId = $existingObject->get('modification_author_id');
if (!$authorId) {
$authorId = $existingObject->get('author_id');
Method __construct
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct($host = '127.0.0.1', $port = null, $options = array())
{
if ($options['secure'] !== null) {
switch (strtolower($options['secure'])) {
case 'tls':
Method buildRegexSQL
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function buildRegexSQL($filter, array $columns, &$joins, &$where)
{
if (Symphony::Log()) {
Symphony::Log()->pushDeprecateWarningToLog(
get_called_class() . '::buildRegexSQL()',
Method Select
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function Select($name, array $options = null, array $attributes = null)
{
General::ensureType(array(
'name' => array('var' => $name, 'type' => 'string')
));
Method viewSuccess
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function viewSuccess()
{
$this->Form->setAttribute('action', SYMPHONY_URL);
$h2 = new XMLElement('h2', __('Updating Complete'));
Method throwDatabaseError
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function throwDatabaseError(Exception $ex = null)
{
if (isset($ex) && $ex) {
$msg = $ex->getMessage();
$errornum = (int)$ex->getCode();
Method create
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function create($name)
{
if (!isset(self::$_pool[$name])) {
$classname = self::__getClassName($name);
$path = self::__getDriverPath($name);
Method displaySettingsPanel
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function displaySettingsPanel(XMLElement &$wrapper, $errors = null)
{
parent::displaySettingsPanel($wrapper, $errors);
// Suggestions
Method displayPublishPanel
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function displayPublishPanel(XMLElement &$wrapper, $data = null, $flagWithError = null, $fieldnamePrefix = null, $fieldnamePostfix = null, $entry_id = null)
{
$name = $this->get('element_name');
$value = null;
Method processPreSaveFilters
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function processPreSaveFilters(XMLElement $result, array &$fields, XMLElement &$post_values, $entry_id = null)
{
$can_proceed = true;
/**
Method login
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function login($username, $password, $isHash = false)
{
$username = trim($username);
$password = trim($password);
Method __actionIndex
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __actionIndex()
{
$checked = (is_array($_POST['items'])) ? array_keys($_POST['items']) : null;
/**
Method view
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function view()
{
$sort = General::sanitize($_REQUEST['sort']);
$sections = (new SectionManager)
->select()
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 enable
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function enable($name)
{
$obj = self::getInstance($name);
// If not installed, install it
Method buildField
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function buildField(array $row)
{
if (!isset($row['id'], $row['type'])) {
return $row;
}
Function generateNonce
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public static function generateNonce($length = 30)
{
$random = null;
if ($length < 1) {
throw new Exception('$length must be greater than 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 checkRequirements
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private function checkRequirements()
{
$errors = [];
$phpVc = new VersionComparator(phpversion());
- 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 renderHeaders
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
protected function renderHeaders()
{
// When the request was made using HTTP 1.0 and the Cache Control header
// was set to 'no-cache', add the Pragma and Expires headers. RE: #2205.
// Thanks to Symfony HttpFoundation for the idea as well.
- 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 fetch
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public static function fetch($section_id = null, $order = 'ASC', $sortfield = 'name')
{
if (Symphony::Log()) {
Symphony::Log()->pushDeprecateWarningToLog('SectionManager::fetch()', '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"