MPOS/php-mpos

View on GitHub

Showing 889 of 1,089 total issues

Method createTemplateCodeFrame has 68 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function createTemplateCodeFrame($content = '', $cache = false)
    {
        $plugins_string = '';
        // include code for plugins
        if (!$cache) {
Severity: Major
Found in include/smarty/libs/sysplugins/smarty_internal_template.php - About 2 hrs to fix

    Method compile has 67 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function compile($args, $compiler)
        {
            // check and get attributes
            $_attr = $this->getAttributes($compiler, $args);
            // save possible attributes
    Severity: Major
    Found in include/smarty/libs/sysplugins/smarty_internal_compile_call.php - About 2 hrs to fix

      Method getTransactions has 67 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        public function getTransactions($start=0, $filter=NULL, $limit=30, $account_id=NULL) {
          $this->debug->append("STA " . __METHOD__, 4);
          $sql = "
            SELECT
              t.id AS id,
      Severity: Major
      Found in include/classes/transaction.class.php - About 2 hrs to fix

        Smarty_Internal_TemplateBase has 24 functions (exceeds 20 allowed). Consider refactoring.
        Open

        abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data
        {
            /**
             * fetches a rendered Smarty template
             *
        Severity: Minor
        Found in include/smarty/libs/sysplugins/smarty_internal_templatebase.php - About 2 hrs to fix

          Method send has 66 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function send(Swift_Mime_Message $message, &$failedRecipients = null)
              {
                  $failedRecipients = (array) $failedRecipients;
          
                  if ($evt = $this->_eventDispatcher->createSendEvent($this, $message)) {
          Severity: Major
          Found in include/lib/swiftmailer/classes/Swift/Transport/MailTransport.php - About 2 hrs to fix

            Function dateFormat has 65 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            var dateFormat = function () {
                var    token = /d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,
                    timezone = /\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,
                    timezoneClip = /[^-+\dA-Z]/g,
                    pad = function (val, len) {
            Severity: Major
            Found in public/site_assets/bootstrap/js/plugins/date.format.js - About 2 hrs to fix

              Method compile has 65 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function compile($args, $compiler)
                  {
                      // check and get attributes
                      $_attr = $this->getAttributes($compiler, $args);
              
              
              Severity: Major
              Found in include/smarty/libs/sysplugins/smarty_internal_compile_section.php - About 2 hrs to fix

                Function smarty_function_html_radios_output has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                Open

                function smarty_function_html_radios_output($name, $value, $output, $selected, $extra, $separator, $labels, $label_ids, $escape)
                {
                    $_output = '';
                
                    if (is_object($value)) {
                Severity: Minor
                Found in include/smarty/libs/plugins/function.html_radios.php - About 2 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

                Function mutingErrorHandler has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                Open

                    public static function mutingErrorHandler($errno, $errstr, $errfile, $errline, $errcontext)
                    {
                        $_is_muted_directory = false;
                
                        // add the SMARTY_DIR to the list of muted directories
                Severity: Minor
                Found in include/smarty/libs/Smarty.class.php - About 2 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

                Function runFilter has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                Open

                    public static function runFilter($type, $content, Smarty_Internal_Template $template)
                    {
                        $output = $content;
                        // loop over autoload filters of specified type
                        if (!empty($template->smarty->autoload_filters[$type])) {
                Severity: Minor
                Found in include/smarty/libs/sysplugins/smarty_internal_filter_handler.php - About 2 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

                Function isTrustedResourceDir has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function isTrustedResourceDir($filepath)
                    {
                        $_template = false;
                        $_config = false;
                        $_secure = false;
                Severity: Minor
                Found in include/smarty/libs/sysplugins/smarty_security.php - About 2 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

                Function getClasses has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                Open

                        public function getClasses(){
                            if (self::$classes === null){
                                $directory = new DirectoryIterator(__DIR__.'/push_notification');
                                foreach ($directory as $fileInfo) {
                                    if (($fileInfo->getExtension() != 'php') || $fileInfo->isDot()) {
                Severity: Minor
                Found in include/classes/pushnotification.class.php - About 2 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

                Function getAllUserStats has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                Open

                  public function getAllUserStats($filter='%',$limit=1,$start=0) {
                    $this->debug->append("STA " . __METHOD__, 4);
                    $sql = "
                      SELECT
                        a.id AS id,
                Severity: Minor
                Found in include/classes/statistics.class.php - About 2 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

                Function streamToMime has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                Open

                    protected function streamToMime(Swift_OutputByteStream $fromStream, Swift_Message $message)
                    {
                        $bufferLength = 78;
                        $headerData = '';
                
                
                Severity: Minor
                Found in include/lib/swiftmailer/classes/Swift/Signers/SMimeSigner.php - About 2 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

                Function setChildren has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function setChildren(array $children, $compoundLevel = null)
                    {
                        // TODO: Try to refactor this logic
                
                        $compoundLevel = isset($compoundLevel)
                Severity: Minor
                Found in include/lib/swiftmailer/classes/Swift/Mime/SimpleMimeEntity.php - About 2 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

                Swift_Transport_EsmtpTransport has 23 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class Swift_Transport_EsmtpTransport extends Swift_Transport_AbstractSmtpTransport implements Swift_Transport_SmtpAgent
                {
                    /**
                     * ESMTP extension handlers.
                     *
                Severity: Minor
                Found in include/lib/swiftmailer/classes/Swift/Transport/EsmtpTransport.php - About 2 hrs to fix

                  Method findUpstreamShare has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    public function findUpstreamShare($aBlock, $last=0) {
                      // Many use stratum, so we create our stratum check first
                      $version = pack("I*", sprintf('%08d', $aBlock['version']));
                      $previousblockhash = pack("H*", swapEndian($aBlock['previousblockhash']));
                      $merkleroot = pack("H*", swapEndian($aBlock['merkleroot']) );
                  Severity: Major
                  Found in include/classes/share.class.php - About 2 hrs to fix

                    Method getAllUserStats has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      public function getAllUserStats($filter='%',$limit=1,$start=0) {
                        $this->debug->append("STA " . __METHOD__, 4);
                        $sql = "
                          SELECT
                            a.id AS id,
                    Severity: Major
                    Found in include/classes/statistics.class.php - About 2 hrs to fix

                      Method yylex1 has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function yylex1()
                          {
                              $tokenMap = array (
                                    1 => 0,
                                    2 => 1,
                      Severity: Major
                      Found in include/smarty/libs/sysplugins/smarty_internal_templatelexer.php - About 2 hrs to fix

                        Method init has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            protected function init()
                            {
                                if (count(self::$_specials) > 0) {
                                    return;
                                }
                        Severity: Major
                        Found in include/lib/swiftmailer/classes/Swift/Mime/Grammar.php - About 2 hrs to fix
                          Severity
                          Category
                          Status
                          Source
                          Language