Showing 482 of 487 total issues
Method send
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
public function send($to, $from, $from_name, $subject, $message,
$html = false, $attachments = array(), $reply_to = false, $reply_to_name = false)
Method sendSystemTemplate
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
public function sendSystemTemplate($to, $from, $from_name, $subject, $email_template_name,
$data = array(), $html = false, $language = false, $attachments = array())
Method makeUserSpaceModule
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
public function makeUserSpaceModule($module_database_table_name,
$module_name,
$auto_install = true,
$parse_database_schema = true,
$database_group = false,
Function init
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.init = function () {
if (translation_map.label_unsaved_changes)
label_unsaved_changes = translation_map.label_unsaved_changes;
Function navFilesTree
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
navFilesTree: function (el, trigger) {
/* if item has .active, leave it open */
$('li', el).each(function () {
if ($('ul a', this).hasClass('active')) {
Method validateByUserId
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function validateByUserId($user_id, $password)
{
// Attempt to select user password metadata
$row = $this->db->select('user_id, hashing_salt, hashing_algorithm, hashing_iterations')
->from($this->getTable())
Method log
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function log($message, $level = self::MESSAGE_LEVEL_INFO, $collection = 'SYSTEM', $resource_id = false, $user_id = false, $timestamp = false)
{
$CI = &get_instance();
$CI->load->helper('date');
Method ip_info
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ip_info($ip)
{
if (!filter_var($ip, FILTER_VALIDATE_IP)) {
throw new InvalidArgumentException('IP is not valid');
}
Method getfile
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getfile()
{
$max = $this->uri->total_segments() + 1;
$current_path = '';
for ($i = 4; $i < $max; $i++) {
Method generate
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function generate()
{
$instance_map = array('loader' => 'load');
$core_components = $this->fetchCoreComponents(array(
Method display
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function display($view = false, $display_header = true, $display_footer = true, $return = false)
{
$return_html = true;
if ($this->already_displayed && !$return) {
return false;
Method mylogin
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function mylogin()
{
$this->load->library('DataGrid');
$this->load->library('LogsRowFormattingUtility');
$this->datagrid->setTable($this->config->item('database_table_logs'), array(
Method revisionrestorefield
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function revisionrestorefield()
{
$id = $this->input->getParam('id');
$revision_id = $this->input->getParam('revision_id');
$field = $this->input->getParam('field');
Method edit
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function edit()
{
$url_suffix = $this->config->item('url_suffix');
$site_language = $this->getAttribute('site_language');
$view = $this->input->getParam('view');
Method orderFieldsByImportance
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function orderFieldsByImportance($definition)
{
$order = array(
FormBuilder::TEXTFIELD,
FormBuilder::PASSWORD,
Function errorHandlerWithLogging
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static function errorHandlerWithLogging($errno, $errstr, $errfile, $errline)
{
if ($errno == E_USER_ERROR) {
if (self::$config->item('debug_log_php_error')) {
Logger::error($errstr . '; line: ' . $errline . '; file: ' . $errfile, 'PHP');
- 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 generateLink
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private static function generateLink($base_url, $page = 1, $order_by = false, $order = false, $filters = false)
{
$url = $base_url;
if ($page > 1) {
$url .= '/page-' . $page;
- 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 install
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function install($module_name, $is_displayed_in_menu = false, $is_displayed_in_utilities = true, $parent_module_id = null)
{
if ($this->isInstalled($module_name)) {
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"
Further reading
Function parseCommandFeedByExplode
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected function parseCommandFeedByExplode($contents, $fields_that_can_contain_spaces = array())
{
// Line counter, -1 meaning reading headers
$line_counter = -1;
// The array containing parsed output
- 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 getAdvancedFeed
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function getAdvancedFeed($columns, $offset, $rowcount, $order_by_column, $order, $filters, $extra_param)
{
if (!$columns || $columns == '*') { // TODO Check if $columns == '*' is ok
$columns = $this->getTable() . '.*';
}
- 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"