Showing 486 of 487 total issues
Method index
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function index()
{
/* Getting module name from class name */
$module_name = strtolower(str_replace('Admin', '', __CLASS__));
Method prepareReplacementTokens
has 13 arguments (exceeds 4 allowed). Consider refactoring. Open
private function prepareReplacementTokens($module_database_table_name,
$module_name,
$module_label,
$module_name_singular,
$definition_output,
Function resizeText
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
resizeText: function (trigger) {
$('#font_resize_bar a').removeClass('active');
var fSizeCookie = readCookie('fSize');
Method _fb_callback_make_filename_seo_friendly
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _fb_callback_make_filename_seo_friendly(&$filename, $base_path, &$data, $current_image_field_name)
{
$data['name'] = 'customization';
// List of the fields to be used, if no value is present for a given key
Function do_setup
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function do_setup()
{
$view = $this->_get_view();
$module = $this->input->getParam('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"
Further reading
Function display
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function display($view = false, $display_header = true, $display_footer = true, $return = false)
{
// Preventing from displaying the same page for several times
if ($this->already_displayed) {
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 compile
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public static function compile($pattern, $object_with_data, $keys_to_be_replaced = array())
{
if (count($keys_to_be_replaced) == 0) {
preg_match_all('/{([a-z_0-9]+)}/', $pattern, $matches);
$keys_to_be_replaced = $matches[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 _edit
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
protected function _edit($is_preview = false, $display_view = true)
{
$forced_filters = $this->getForcedFilters();
$definition = $this->getDefinition();
- 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 dumpFile
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function dumpFile($path, $array, $arrayName = 'lang')
{
$contents = "<?php if(!defined('BASEPATH')) exit('No direct script access allowed');\n\n";
if (count($array) == 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 getBasicFeed
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function getBasicFeed($extra_param)
{
$data = array();
$pattern = '/\[(?P<datetime>.*)\] (?P<logger>\w+).(?P<level>\w+): (?P<message>.*[^ ]+) (?P<context>[^ ]+) (?P<extra>[^ ]+)/';
- 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 _fb_callback_make_filename_seo_friendly
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function _fb_callback_make_filename_seo_friendly(&$filename, $base_path, &$data, $current_image_field_name)
{
// List of the fields to be used, if no value is present for a given key
// then the key will be ignored. By default all values of the keys
// specified will be concatenated
- 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 parsePolicy
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function parsePolicy($path)
{
if (!file_exists($path)) {
return false;
}
Method getFieldDefaults
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getFieldDefaults()
{
$defaults = array();
$defaults['field'] = false; // Field name
$defaults['label'] = false; // Field label
Method edit
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function edit()
{
$module = $this->input->getParam('module');
$language = $this->input->getParam('language');
$key = $this->input->getParam('key');
Method _fb_callback_make_filename_seo_friendly
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _fb_callback_make_filename_seo_friendly(&$filename, $base_path, &$data, $current_image_field_name)
{
// List of the fields to be used, if no value is present for a given key
// then the key will be ignored. By default all values of the keys
// specified will be concatenated
Method isAuthenticated
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function isAuthenticated($force_do_all_checks_again = false)
{
if (!$force_do_all_checks_again) {
if ($this->is_authenticated !== null) {
// Kind of cache
Method describeClass
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function describeClass($class, $must_be_declaring = true)
{
$ignored_methods = array(
'ModuleAdminController',
'getPrivileges',
Method dashboard
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function dashboard()
{
$user_manual_path = false;
if (file_exists('uploads/user-manual.pdf')) {
$user_manual_path = 'uploads/user-manual.pdf';
Method getFieldDefaults
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getFieldDefaults()
{
$defaults = array();
$defaults['field'] = false; // Field name
$defaults['label'] = false; // Field label
Method tailAFile
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function tailAFile($path, $count = 10)
{
if (!file_exists($path)) {
return false;
}