Showing 482 of 487 total issues
Method update
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public function update($user_id, $display_name, $user_login = false, $group_ids = false, $password = false, $is_root = null, $data = array())
Method mysqldump
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
function mysqldump($db_host, $database, $db_user, $db_password, $tables = false, $dump_to_filename = false, $dump_structure = true)
Method getAdvancedFeed
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public function getAdvancedFeed($columns, $start, $rowcount, $orderby_column, $order, $filters, $extra_param);
Function hasAccess
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function hasAccess($controller, $method = false, $module = false)
{
if (!$method) {
$method = 'index';
}
- 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 copyFileSsh
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function copyFileSsh($host, $port, $login = false, $password = false, $local_file = false, $remote_file = false)
Function valid_timestamp
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function valid_timestamp($str)
{
if (strlen($str) == 0) {
return true;
}
- 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 log
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function log($message, $level = self::MESSAGE_LEVEL_INFO, $collection = 'SYSTEM', $resource_id = false, $user_id = false, $timestamp = false)
Method getAssocPairs
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function getAssocPairs($key_column_name, $value_column_name, $table = false, $imitial_array = false,
$possible_keys = false, $where_conditions = false)
Method move
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function move($id, $direction, $table = false, $constraint_field_name = false,
$item_order_field_name = 'item_order', $id_field_name = 'id')
Method enableJournaling
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function enableJournaling($journaling_table = false, $include_fields = array(), $exclude_fields = array(),
$tag = null, $serialization_method = null, $unserialization_method = null)
Function setupDefaultConfig
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function setupDefaultConfig()
{
$this->load->config('editor');
$descriptor['editor_css_file'] = $this->config->item('editor_css_file');
$descriptor['editor_css_body_id'] = $this->config->item('editor_css_body_id');
- 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 getMenuFlat
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getMenuFlat($parent_item_id = 0, $language_code = 'en', $dont_enter_item_id = false, $separator = false, &$menu = array(), $return = true, $prefix = '')
{
if (!$language_code) {
$language_code = 'en';
}
- 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 display_breadcrumb
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function display_breadcrumb($breadcrumb_array, $icon = false)
{
$count = count($breadcrumb_array);
$o = '';
- 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
Avoid deeply nested control flow statements. Open
for ($i = 0; $i < 99; $i++) {
$keys[] = $i;
}
Function __construct
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function __construct()
{
// Getting cache path from configuration
$path = $this->config->raw_item('cache_path');
$this->is_enabled = $this->config->raw_item('cache_object_is_enabled');
- 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 google_maps_locate
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function google_maps_locate($address)
{
$url = 'http://maps.google.com/maps/api/geocode/json?address=' . urlencode($address) . '&components=country:PL&sensor=false';
$contents = file_get_contents($url);
if (!$contents) {
- 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 generateCSV
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function generateCSV($feed, $headers = false, $file_name = false, $send = true, $separator = false, $print_headers = true)
Method generateExcel
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function generateExcel($feed, $headers = false, $file_name = false, $send = true, $print_headers = true, $excel_type = Spreadsheet::EXCEL_XLS)
Function getTranslatedValue
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function getTranslatedValue(array $definition, $fieldKey, $suffix = '')
{
$translatedValue = false;
if ($this->lang !== null) {
- 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 buildSubmenuUrl
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function buildSubmenuUrl($module, $item, $language_code)
{
if (!$module->name) {
$submenu_url = admin_url() . $item[self::PROP_CONTROLLER] . '/';
} elseif (isset($item[self::PROP_MODULE]) && $item[self::PROP_MODULE]) {
- 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"