ImpressCMS/impresscms

View on GitHub

Showing 540 of 47,256 total issues

Function icms_getfloat has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

function icms_getfloat($str, $set=FALSE)
{
    if(preg_match("/([0-9\.,-]+)/", $str, $match))
    {
        // Found number in $str, so set $str that number
Severity: Minor
Found in htdocs/include/functions.php - About 1 hr to fix

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 icms_getModuleConfig has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

function &icms_getModuleConfig($moduleName = false)
{
    static $icmsConfigs;
    if(isset ($icmsConfigs[$moduleName]))
    {
Severity: Minor
Found in htdocs/include/functions.php - About 1 hr to fix

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 __construct has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    function __construct() {
        if (isset( $_SESSION['settings']['ROOT_PATH'] )) {
            $this->xoopsRootPath = $_SESSION['settings']['ROOT_PATH'];
        } else {
            $path = str_replace( "\\", "/", @realpath( '../' ) );
Severity: Minor
Found in htdocs/install/page_pathsettings.php - About 1 hr to fix

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 AllowedMimeTypes has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function AllowedMimeTypes() {
        $GrantedItems =  $this->UserCanUpload();
        $array = array();
        $grantedItemValues = array_values($GrantedItems);
        if (!empty($grantedItemValues)) {
Severity: Minor
Found in htdocs/modules/system/admin/mimetype/class/mimetype.php - About 1 hr to fix

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 b_system_login_show has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

function b_system_login_show() {
    global $icmsConfig, $icmsConfigAuth, $icmsConfigUser;
    if (!icms::$user) {
        $block = array();
        $block['lang_username'] = _USERNAME;
Severity: Minor
Found in htdocs/modules/system/blocks/system_blocks.php - About 1 hr to fix

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 imanager_updatecat has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

function imanager_updatecat() {
    /* because we are using a function, the GET/POST variables are not in scope */
    global $imgcat_id, $imgcat_name, $imgcat_display, $imgcat_maxsize, $imgcat_maxwidth, $imgcat_maxheight, $imgcat_weight, $readgroup, $writegroup;
    if (!icms::$security->check() || $imgcat_id <= 0) {
        redirect_header('admin.php?fct=images', 1, implode('<br />', icms::$security->getErrors()));
Severity: Minor
Found in htdocs/modules/system/admin/images/main.php - About 1 hr to fix

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 imanager_reordercateg has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

function imanager_reordercateg() {
    if (!icms::$security->check()) {
        redirect_header('admin.php?fct=images', 1, implode('<br />', icms::$security->getErrors()));
    }
    $count = count($_POST['imgcat_weight']);
Severity: Minor
Found in htdocs/modules/system/admin/images/main.php - About 1 hr to fix

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 xoFormFieldCharset has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function xoFormFieldCharset($name, $value, $label, $link, $help = '') {
    if (version_compare(getDBVersion($link), "4.1.0", "lt")) {
        return "";
    }
    if (!$chars = getDbCharsets($link)) {
Severity: Minor
Found in htdocs/install/page_dbsettings.php - About 1 hr to fix

    Method Generate_PDF has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function Generate_PDF ($content, $doc_title, $doc_keywords) {
        global $icmsConfig;
        require_once ICMS_PDF_LIB_PATH.'/tcpdf.php';
        icms_loadLanguageFile('core', 'pdf');
        $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true);
    Severity: Minor
    Found in htdocs/include/pdf.php - About 1 hr to fix

      Method makeWritable has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function makeWritable( $path, $group = false, $recurse = false) {
              if (!file_exists( $path )) {
                  return false;
              }
              $perm = @is_dir( $path ) ? 6 : 7;
      Severity: Minor
      Found in htdocs/install/page_pathsettings.php - About 1 hr to fix

        Method getHtml4Assign has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function getHtml4Assign() {
                $as_md5 = $this->getMd5();
                $as_md5array = preg_split('//', $as_md5, -1, PREG_SPLIT_NO_EMPTY);
                $as_md5shuffle = array ();
                foreach ($as_md5array as $key => $val) {

          Method imanager_delfileok has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function imanager_delfileok($image_id, $redir = NULL) {
              if (!icms::$security->check()) {
                  redirect_header('admin.php?fct=images', 3, implode('<br />', icms::$security->getErrors()));
              }
          
          
          Severity: Minor
          Found in htdocs/modules/system/admin/images/main.php - About 1 hr to fix

            Method imanager_editcat has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function imanager_editcat($imgcat_id) {
                if ($imgcat_id <= 0) {
                    redirect_header('admin.php?fct=images', 1);
                }
                $imgcat_handler = icms::handler('icms_image_category');
            Severity: Minor
            Found in htdocs/modules/system/admin/images/main.php - About 1 hr to fix

              Function getElementsByClassName has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              if (!document.getElementsByClassName) document.getElementsByClassName = function(instanceMethods){
                  function iter(name) {
                      return name.blank() ? null : "[contains(concat(' ', @class, ' '), ' " + name + " ')]";
                  }
              
              
              Severity: Minor
              Found in htdocs/install/prototype.js - About 1 hr to fix

                Function addMethods has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    function addMethods(source) {
                        var ancestor   = this.superclass && this.superclass.prototype,
                            properties = Object.keys(source);
                
                        if (IS_DONTENUM_BUGGY) {
                Severity: Minor
                Found in htdocs/install/prototype.js - About 1 hr to fix

                  Method icms_purifyText has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function icms_purifyText($text, $keyword = false) {
                      $text = str_replace('&nbsp;', ' ', $text);
                      $text = str_replace('<br />', ' ', $text);
                      $text = str_replace('<br/>', ' ', $text);
                      $text = str_replace('<br', ' ', $text);
                  Severity: Minor
                  Found in htdocs/include/functions.php - About 1 hr to fix

                    Method xoops_comment_delete has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function xoops_comment_delete($module_id, $item_id)
                    {
                        if( (int) ($module_id) > 0 && (int) ($item_id) > 0)
                        {
                            $comment_handler = icms::handler('icms_data_comment');
                    Severity: Minor
                    Found in htdocs/include/functions.php - About 1 hr to fix

                      Method __construct has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          function __construct() {
                              if (isset( $_SESSION['settings']['ROOT_PATH'] )) {
                                  $this->xoopsRootPath = $_SESSION['settings']['ROOT_PATH'];
                              } else {
                                  $path = str_replace( "\\", "/", @realpath( '../' ) );
                      Severity: Minor
                      Found in htdocs/install/page_pathsettings.php - About 1 hr to fix

                        Method showRSS has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function showRSS() {
                            global $icmsAdminTpl, $icmsConfigPersona;
                        
                            $rssurl = $icmsConfigPersona['rss_local'];
                            $rssfile = ICMS_CACHE_PATH . '/adminnews_' . _LANGCODE . '.xml';
                        Severity: Minor
                        Found in htdocs/admin.php - About 1 hr to fix

                          Method adminNav has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function adminNav($id = NULL, $separador = "/", $list = FALSE, $style = "style='font-weight:bold'") {
                              global $target, $type;
                          
                              $admin_url = 'browser.php?target=' . $target . '&type=' . $type;
                              if ($id === FALSE) {
                          Severity: Minor
                          Found in htdocs/modules/system/admin/images/browser.php - About 1 hr to fix
                            Severity
                            Category
                            Status
                            Source
                            Language