Showing 486 of 487 total issues
Function applyFilters
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public static function applyFilters($db, $filters)
{
$allowed_conditions = array(
'eq' => '=',
'ne' => '!=',
- 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 Setup.php
has 288 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* PepisCMS
*
Method index
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function index()
{
$this->installer_helper->buildFileStructure(INSTALLATIONPATH);
// When the Symfony2 configuration is not present, display the native connection only
Method index
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function index()
{
if (!$this->auth->getDriver()->isPasswordChangeSupported()) {
show_404();
}
DefaultFormRenderer
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
class DefaultFormRenderer extends ContainerAware implements FormRenderableInterface
{
protected $is_js_included = false;
protected $validation_message_prefix = false;
protected $validation_message_suffix = false;
Method send
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function send($to, $from, $from_name, $subject, $message,
$html = false, $attachments = array(), $reply_to = false, $reply_to_name = false)
{
if (!$html) {
$message = str_replace("\r\n", "\n", $message);
Method edit
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function edit()
{
$group_id = $this->input->getParam('id');
$add_new = !($group_id > 0);
Function parseExcel
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function parseExcel($path, $first_row_as_keys = true, $normalize_keys = true)
{
if (!$this->isFullyEnabled()) {
throw new \RuntimeException("PhpSpreadsheet is not enabled. Please refer to README.md");
}
- 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 getjsonfilelist
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function getjsonfilelist()
{
$files = $dirs = array();
$user_files_dir = $this->uploadsPath;
$current_path = isset($_POST['path']) ? str_replace('//', '/', str_replace('../', '', $_POST['path'] . '/')) : '/';
- 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 fix_autoincrement_on_cms_tables
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function fix_autoincrement_on_cms_tables()
{
$tables = array(
'database_table_users' => array('user_id', 'INT UNSIGNED'),
'database_table_group_to_entity' => array('id', 'INT'),
- 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 _model
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
private function _model($model, $name = '', $db_conn = false, $hardfail = true)
{
if (is_array($model)) {
foreach ($model as $babe) {
$this->model($babe);
- 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 getjsonfilelist
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getjsonfilelist()
{
$files = $dirs = array();
$user_files_dir = $this->uploadsPath;
$current_path = isset($_POST['path']) ? str_replace('//', '/', str_replace('../', '', $_POST['path'] . '/')) : '/';
Method edit
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function edit()
{
$section = $this->input->getParam('section');
$is_editable = ($section != 'system' && !$this->Module_model->isCoreModule($section)) || !PEPISCMS_PRODUCTION_RELEASE;
Method generateCSV
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function generateCSV($feed, $headers = false, $file_name = false, $send = true, $separator = false, $print_headers = true)
{
if (!$separator) {
$separator = ',';
}
Auth
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
class Auth extends ContainerAware
{
const LOGGED_COOKIE_NAME = 'pepiscms_logged';
/**
* Auth update timeout in seconds
Method parseCSV
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function parseCSV($path, $first_row_as_keys = true, $normalize_keys = true, $separator = false)
{
$lines = array();
$keys = array();
if (file_exists($path)) {
Method module_make
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function module_make()
{
$this->assign('title', $this->lang->line('development_make_a_new_module'));
$this->assign('success', false);
Function makeConfigurationTestsAngGetErrors
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function makeConfigurationTestsAngGetErrors()
{
$cache_path = $this->config->item('cache_path');
$cache_path = ($cache_path === '') ? 'application/cache/' : $cache_path;
if ($cache_path[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 localizeDefinition
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function localizeDefinition(&$definition, TranslateableInterface $object)
{
$this->load->model('Site_language_model');
$languages = $this->Site_language_model->getLanguages();
if (count($languages) == 1) {
- 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 journalingPersistPreSave
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
protected function journalingPersistPreSave($id, $data)
{
if (!$id || !$this->getJournalingIsEnabled()) {
return 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"