MPOS/php-mpos

View on GitHub

Showing 889 of 1,089 total issues

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

    private function _establishSocketConnection()
    {
        $host = $this->_params['host'];
        if (!empty($this->_params['protocol'])) {
            $host = $this->_params['protocol'] . '://' . $host;
Severity: Minor
Found in include/lib/swiftmailer/classes/Swift/Transport/StreamBuffer.php - About 1 hr to fix

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

    function run_102() {
      // Ugly but haven't found a better way
      global $setting, $config, $coin_address, $user, $mysqli;
    
      // Version information
    Severity: Minor
    Found in upgrade/definitions/1.0.1_to_1.0.2.inc.php - About 1 hr to fix

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

      function smarty_modifier_truncate($string, $length = 80, $etc = '...', $break_words = false, $middle = false)
      {
          if ($length == 0)
              return '';
      
      
      Severity: Minor
      Found in include/smarty/libs/plugins/modifier.truncate.php - About 1 hr to fix

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

            public function isTrustedPHPDir($filepath)
            {
                if (empty($this->trusted_dir)) {
                    throw new SmartyException("directory '{$filepath}' not allowed by security setting (no trusted_dir specified)");
                }
        Severity: Minor
        Found in include/smarty/libs/sysplugins/smarty_security.php - About 1 hr to fix

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

              public static function get_debug_vars($obj)
              {
                  $config_vars = $obj->config_vars;
                  $tpl_vars = array();
                  foreach ($obj->tpl_vars as $key => $var) {
          Severity: Minor
          Found in include/smarty/libs/sysplugins/smarty_internal_debug.php - About 1 hr to fix

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

                public function populateCompiledFilepath(Smarty_Template_Compiled $compiled, Smarty_Internal_Template $_template)
                {
                    $_compile_id = isset($_template->compile_id) ? preg_replace('![^\w\|]+!', '_', $_template->compile_id) : null;
                    $_filepath = $compiled->source->uid;
                    // if use_sub_dirs, break file into directories
            Severity: Minor
            Found in include/smarty/libs/sysplugins/smarty_resource.php - About 1 hr to fix

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

                public function resetPassword($token, $new1, $new2) {
                  $this->debug->append("STA " . __METHOD__, 4);
                  if ($aToken = $this->token->getToken($token, 'password_reset')) {
                    if ($new1 !== $new2) {
                      $this->setErrorMessage( 'New passwords do not match' );
              Severity: Minor
              Found in include/classes/user.class.php - About 1 hr to fix

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

                function check_acl_access($params, $smarty)
                {
                  $isAuthenticated = isset($_SESSION['AUTHENTICATED']) ? true : false;
                  $iAclSetting = $params['acl'];
                  // $params['icon'] is deprecated, only needed for mpos compatibility
                Severity: Minor
                Found in include/lib/smarty_plugins/function.acl.php - About 1 hr to fix

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

                      protected function doHeaders($text) {
                      #
                      # Redefined to add id and class attribute support.
                      #
                          # Setext-style headers:
                  Severity: Minor
                  Found in include/lib/Michelf/Markdown.php - About 1 hr to fix

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

                        protected function doFencedCodeBlocks($text) {
                        #
                        # Adding the fenced code block syntax to regular Markdown:
                        #
                        # ~~~
                    Severity: Minor
                    Found in include/lib/Michelf/Markdown.php - About 1 hr to fix

                      Consider simplifying this complex logical expression.
                      Open

                          if (isset($aTransaction['address']) &&
                            $aTransaction['address'] == $aDebitTx['coin_address'] &&
                            ((string)($aTransaction['amount'] + $aTransaction['fee'])    == (string)($aDebitTx['amount'] * -1) ||     // Check against transaction - Fee total
                             (string)($aTransaction['amount'] + $config['txfee_manual']) == (string)($aDebitTx['amount'] * -1) ||     // Check against txfee_manual deducted
                             (string)($aTransaction['amount'] + $config['txfee_auto'])   == (string)($aDebitTx['amount'] * -1) ||     // Check against txfee_auto deducted
                      Severity: Major
                      Found in scripts/validate_payouts.php - About 1 hr to fix

                        Consider simplifying this complex logical expression.
                        Open

                                if ($compiler->template->caching && ((!$compiler->inheritance && !$compiler->nocache && !$compiler->tag_nocache) || ($compiler->inheritance && ($compiler->nocache ||$compiler->tag_nocache)))) {
                                    $_caching = self::CACHING_NOCACHE_CODE;
                                }
                        Severity: Major
                        Found in include/smarty/libs/sysplugins/smarty_internal_compile_include.php - About 1 hr to fix

                          Consider simplifying this complex logical expression.
                          Open

                                  if ((!$this->_template_dir || $this->_template_dir !== $_template_dir)
                                          || (!$this->_config_dir || $this->_config_dir !== $_config_dir)
                                          || (!empty($this->secure_dir) && (!$this->_secure_dir || $this->_secure_dir !== $this->secure_dir))
                                  ) {
                                      $this->_resource_dir = array();
                          Severity: Major
                          Found in include/smarty/libs/sysplugins/smarty_security.php - About 1 hr to fix

                            Method setupInlineSubTemplate has 8 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                public function setupInlineSubTemplate($template, $cache_id, $compile_id, $caching, $cache_lifetime, $data, $parent_scope, $hash)
                            Severity: Major
                            Found in include/smarty/libs/sysplugins/smarty_internal_template.php - About 1 hr to fix

                              Consider simplifying this complex logical expression.
                              Open

                                            if (empty($filter['type']) || ($filter['type'] != 'Debit_AP' && $filter['type'] != 'Debit_MP' && $filter['type'] != 'TXFee' && $filter['type'] != 'Credit_PPS' && $filter['type'] != 'Fee_PPS' && $filter['type'] != 'Donation_PPS')) {
                                              $aFilter[] = "( b.confirmations >= " . $this->config['confirmations'] . " OR ISNULL(b.confirmations) )";
                                            }
                              Severity: Major
                              Found in include/classes/transaction.class.php - About 1 hr to fix

                                Method updateAccount has 8 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                  public function updateAccount($userID, $address, $threshold, $donate, $email, $timezone, $is_anonymous, $strToken) {
                                Severity: Major
                                Found in include/classes/user.class.php - About 1 hr to fix

                                  Function smarty_outputfilter_trimwhitespace has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  function smarty_outputfilter_trimwhitespace($source, Smarty_Internal_Template $smarty)
                                  {
                                      $store = array();
                                      $_store = 0;
                                      $_offset = 0;
                                  Severity: Minor
                                  Found in include/smarty/libs/plugins/outputfilter.trimwhitespace.php - About 55 mins 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 run_009 has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  function run_009() {
                                    // Ugly but haven't found a better way
                                    global $setting, $config, $user, $mysqli;
                                  
                                    // Version information
                                  Severity: Minor
                                  Found in upgrade/definitions/0.0.8_to_0.0.9.inc.php - About 55 mins 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 run_0014 has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  function run_0014() {
                                    // Ugly but haven't found a better way
                                    global $setting, $config, $user, $mysqli;
                                  
                                    // Version information
                                  Severity: Minor
                                  Found in upgrade/definitions/0.0.13_to_0.0.14.inc.php - About 55 mins 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 run_008 has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  function run_008() {
                                    // Ugly but haven't found a better way
                                    global $setting, $config, $statistics, $block, $mysqli;
                                  
                                    // Version information
                                  Severity: Minor
                                  Found in upgrade/definitions/0.0.7_to_0.0.8.inc.php - About 55 mins 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

                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language