SpamExperts/whmcs-addon

View on GitHub

Showing 25 of 72 total issues

File bootstrap.js has 1412 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* ===================================================
 * bootstrap-transition.js v2.1.1
 * http://twitter.github.com/bootstrap/javascript.html#transitions
 * ===================================================
 * Copyright 2012 Twitter, Inc.
Severity: Major
Found in modules/addons/spamexperts/core/assets/js/bootstrap.js - About 3 days to fix

    Function query has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
    Open

            public function query($and = false, $where = false, $limit = true)
            {
                $query = ' '; 
    
                if($and && count($this->settings['filters']))
    Severity: Minor
    Found in modules/addons/spamexperts/core/class.MG_Pagination.php - About 4 hrs 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

    Consider simplifying this complex logical expression.
    Open

        if (!$IS_CLIENTAREA && isset($_REQUEST['modsubpage'])
            && in_array($PAGE, $available_pages)
            && in_array($_REQUEST['modsubpage'], $available_pages)
            && file_exists(ADDON_DIR . DS . 'pages' . DS . $PAGE . DS . $_REQUEST['modsubpage'] . '.php')
        ) {
    Severity: Critical
    Found in modules/addons/spamexperts/core/core.php - About 3 hrs to fix

      Consider simplifying this complex logical expression.
      Open

          if (!$IS_CLIENTAREA && isset($_REQUEST['modsubpage'])
              && in_array($PAGE, $available_pages)
              && in_array($_REQUEST['modsubpage'], $available_pages)
              && file_exists(ADDON_DIR . DS . 'views' . DS . $PAGE . DS . $_REQUEST['modsubpage'] . '.php')
          ) {
      Severity: Critical
      Found in modules/addons/spamexperts/core/core.php - About 3 hrs to fix

        Method query has 48 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                public function query($and = false, $where = false, $limit = true)
                {
                    $query = ' '; 
        
                    if($and && count($this->settings['filters']))
        Severity: Minor
        Found in modules/addons/spamexperts/core/class.MG_Pagination.php - About 1 hr to fix

          Function kwspamexperts_getLang has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
          Open

              function kwspamexperts_getLang($params){
                  global $CONFIG;
                  if(!empty($_SESSION['Language']))
                      $language = strtolower($_SESSION['Language']);
                  else if(isset($params['clientsdetails']['language']) && strtolower($params['clientsdetails']['language'])!='')
          Severity: Minor
          Found in modules/servers/kwspamexperts/kwspamexperts.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 show has 43 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            , show: function () {
                var $tip
                  , inside
                  , pos
                  , actualWidth
          Severity: Minor
          Found in modules/addons/spamexperts/core/assets/js/bootstrap.js - About 1 hr to fix

            Function hide_pass_in_clientarea_spamexperts has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

                function hide_pass_in_clientarea_spamexperts() {
                    global $smarty;
            
                    if (!defined('Smarty::SMARTY_VERSION')) {
                        if($smarty->_tpl_vars['filename'] == 'clientarea' &&
            Severity: Minor
            Found in modules/servers/spamexpertsreseller/hooks.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 spamexpertsreseller_getLang has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

                function spamexpertsreseller_getLang($params){
                    global $CONFIG;
                    if(!empty($_SESSION['Language']))
                        $language = strtolower($_SESSION['Language']);
                    else if(isset($params['clientsdetails']['language']) && strtolower($params['clientsdetails']['language'])!='')
            Severity: Minor
            Found in modules/servers/spamexpertsreseller/spamexpertsreseller.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 hide_pass_in_clientarea_spamexperts has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

                function hide_pass_in_clientarea_spamexperts() {
                    global $smarty;
            
                    if (!defined('Smarty::SMARTY_VERSION')) {
                        if($smarty->_tpl_vars['filename'] == 'clientarea' &&
            Severity: Minor
            Found in modules/servers/kwspamexperts/hooks.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 spamexpertsreseller_getLang has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

                function spamexpertsreseller_getLang($params){
                     global $CONFIG;
                     if(!empty($_SESSION['Language']))
                         $language = strtolower($_SESSION['Language']);
                     else if(isset($params['clientsdetails']['language']) && strtolower($params['clientsdetails']['language'])!='')
            Severity: Minor
            Found in modules/servers/kwspamexperts/spamexpertsreseller.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 kwspamexperts_ConfigOptions has 37 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function kwspamexperts_ConfigOptions() {
                $configarray = array(
                 "ProductType"      => array(
                         "Type"         => "dropdown",
                         "Options"      => "Incoming,Outgoing,Both",
            Severity: Minor
            Found in modules/servers/kwspamexperts/kwspamexperts.php - About 1 hr to fix

              Function slide has 36 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                , slide: function (type, next) {
                    var $active = this.$element.find('.item.active')
                      , $next = next || $active[type]()
                      , isCycling = this.interval
                      , direction = type == 'next' ? 'left' : 'right'
              Severity: Minor
              Found in modules/addons/spamexperts/core/assets/js/bootstrap.js - About 1 hr to fix

                Method spamexpertsreseller_ConfigOptions has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function spamexpertsreseller_ConfigOptions()
                {
                    $configarray = array(
                        "SpampanelURL"     => array(
                            "Type"         => "text",
                Severity: Minor
                Found in modules/servers/spamexpertsreseller/spamexpertsreseller.php - About 1 hr to fix

                  Method spamexpertsreseller_ConfigOptions has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function spamexpertsreseller_ConfigOptions() 
                  {
                      $configarray = array(
                       "SpampanelURL"     => array(
                               "Type"         => "text", 
                  Severity: Minor
                  Found in modules/servers/kwspamexperts/spamexpertsreseller.php - About 1 hr to fix

                    Method kwspamexperts_CreateAccount has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function kwspamexperts_CreateAccount($params)
                    {
                        $api        = new kwspamexperts_api($params);
                        $domain     = !empty($params["customfields"]["Domain"])  ? $params["customfields"]["Domain"] : $params['domain'];
                        $password   = !empty($params['password'])                ? $params["password"]               : createServerPassword();
                    Severity: Minor
                    Found in modules/servers/kwspamexperts/kwspamexperts.php - About 1 hr to fix

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

                           function kwspamexperts_management($params){
                               global $CONFIG;
                               $lang              = kwspamexperts_getLang($params);
                               $api               = new kwspamexperts_api($params);
                               $page              = (isset($_GET['page'])                      ? addslashes($_GET['page'])          : 'mainsite');
                      Severity: Minor
                      Found in modules/servers/kwspamexperts/kwspamexperts.php - About 1 hr to fix

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

                             function spamexpertsreseller_management($params){
                                 // phpcs:ignore PHPCS_SecurityAudit.BadFunctions.EasyRFI.WarnEasyRFI
                                 include_once(__DIR__.DIRECTORY_SEPARATOR.'class.connection.php');
                                 global $CONFIG;    
                                 $lang              = spamexpertsreseller_getLang($params); 
                        Severity: Minor
                        Found in modules/servers/kwspamexperts/spamexpertsreseller.php - About 1 hr to fix

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

                               function spamexpertsreseller_management($params){
                                   // phpcs:ignore PHPCS_SecurityAudit.BadFunctions.EasyRFI.WarnEasyRFI
                                   include_once(__DIR__.DIRECTORY_SEPARATOR.'class.connection.php');
                                   global $CONFIG;    
                                   $lang              = spamexpertsreseller_getLang($params); 
                          Severity: Minor
                          Found in modules/servers/spamexpertsreseller/spamexpertsreseller.php - About 1 hr to fix

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

                                , show: function () {
                                    var that = this
                                      , e = $.Event('show')
                            
                                    this.$element.trigger(e)
                            Severity: Minor
                            Found in modules/addons/spamexperts/core/assets/js/bootstrap.js - About 1 hr to fix
                              Severity
                              Category
                              Status
                              Source
                              Language