MPOS/php-mpos

View on GitHub

Showing 889 of 1,089 total issues

Method onCommand has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function onCommand(Swift_Transport_SmtpAgent $agent, $command, $codes = array(), &$failedRecipients = null, &$stop = false);
Severity: Minor
Found in include/lib/swiftmailer/classes/Swift/Transport/EsmtpHandler.php - About 35 mins to fix

    Method createMessage3 has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        protected function createMessage3($domain, $username, $workstation, $lmResponse, $ntlmResponse)

      Method mail has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          public function mail($to, $subject, $body, $headers = null, $extraParams = null)
      Severity: Minor
      Found in include/lib/swiftmailer/classes/Swift/Transport/SimpleMailInvoker.php - About 35 mins to fix

        Method mail has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            public function mail($to, $subject, $body, $headers = null, $extraParams = null);
        Severity: Minor
        Found in include/lib/swiftmailer/classes/Swift/Transport/MailInvoker.php - About 35 mins to fix

          Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              public function __construct(Swift_Mime_HeaderSet $headers, Swift_Mime_ContentEncoder $encoder, Swift_KeyCache $cache, Swift_Mime_Grammar $grammar, $mimeTypes = array())
          Severity: Minor
          Found in include/lib/swiftmailer/classes/Swift/Mime/Attachment.php - About 35 mins to fix

            Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                public function __construct(Swift_Mime_HeaderSet $headers, Swift_Mime_ContentEncoder $encoder, Swift_KeyCache $cache, Swift_Mime_Grammar $grammar, $charset = null)
            Severity: Minor
            Found in include/lib/swiftmailer/classes/Swift/Mime/MimePart.php - About 35 mins to fix

              Method createPhrase has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  protected function createPhrase(Swift_Mime_Header $header, $string, $charset, Swift_Mime_HeaderEncoder $encoder = null, $shorten = false)
              Severity: Minor
              Found in include/lib/swiftmailer/classes/Swift/Mime/Headers/AbstractHeader.php - About 35 mins to fix

                Function enableSecurity has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function enableSecurity($security_class = null)
                    {
                        if ($security_class instanceof Smarty_Security) {
                            $this->security_policy = $security_class;
                
                
                Severity: Minor
                Found in include/smarty/libs/Smarty.class.php - About 35 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 getGlobal has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function getGlobal($varname = null)
                    {
                        if (isset($varname)) {
                            if (isset(self::$global_tpl_vars[$varname])) {
                                return self::$global_tpl_vars[$varname]->value;
                Severity: Minor
                Found in include/smarty/libs/Smarty.class.php - About 35 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 isTrustedUri has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function isTrustedUri($uri)
                    {
                        $_uri = parse_url($uri);
                        if (!empty($_uri['scheme']) && !empty($_uri['host'])) {
                            $_uri = $_uri['scheme'] . '://' . $_uri['host'];
                Severity: Minor
                Found in include/smarty/libs/sysplugins/smarty_security.php - About 35 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 parse_single_quoted_string has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    private static function parse_single_quoted_string($qstr) {
                        $escaped_string = substr($qstr, 1, strlen($qstr)-2); //remove outer quotes
                
                        $ss = preg_split('/(\\\\.)/', $escaped_string, -1, PREG_SPLIT_DELIM_CAPTURE);
                
                
                Severity: Minor
                Found in include/smarty/libs/sysplugins/smarty_internal_configfileparser.php - About 35 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 createLocalArrayVariable has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function createLocalArrayVariable($tpl_var, $nocache = false, $scope = Smarty::SCOPE_LOCAL)
                    {
                        if (!isset($this->tpl_vars[$tpl_var])) {
                            $this->tpl_vars[$tpl_var] = new Smarty_variable(array(), $nocache, $scope);
                        } else {
                Severity: Minor
                Found in include/smarty/libs/sysplugins/smarty_internal_template.php - About 35 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 listInvalidationKeys has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    protected function listInvalidationKeys($cid, $resource_name = null, $cache_id = null, $compile_id = null, $resource_uid = null)
                    {
                        $t = array('IVK#ALL');
                        $_name = $_compile = '#';
                        if ($resource_name) {
                Severity: Minor
                Found in include/smarty/libs/sysplugins/smarty_cacheresource_keyvaluestore.php - About 35 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 closeTag has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function closeTag($compiler, $expectedTag)
                    {
                        if (count($compiler->_tag_stack) > 0) {
                            // get stacked info
                            list($_openTag, $_data) = array_pop($compiler->_tag_stack);
                Severity: Minor
                Found in include/smarty/libs/sysplugins/smarty_internal_compilebase.php - About 35 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 cleanupTokens has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                  public function cleanupTokens() {
                    // Get all tokens that have an expiration set
                    if (!$aTokenTypes = $this->tokentype->getAllExpirations()) {
                      // Verbose error for crons since this should not happen
                      $this->setCronMessage('Failed to fetch tokens with expiration times: ' . $this->tokentype->getCronError());
                Severity: Minor
                Found in include/classes/token.class.php - About 35 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 compile has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function compile($args, $compiler)
                    {
                        static $_is_legal_scope = array('local' => true,'parent' => true,'root' => true,'global' => true);
                        // check and get attributes
                        $_attr = $this->getAttributes($compiler, $args);
                Severity: Minor
                Found in include/smarty/libs/sysplugins/smarty_internal_compile_config_load.php - About 35 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 getErrorMsg has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                  public function getErrorMsg($errCode='') {
                    if (!is_array($this->aErrorCodes)) return 'Error codes not loaded';
                    if (!array_key_exists($errCode, $this->aErrorCodes)) return 'Unknown Error Code: ' . $errCode;
                    if (func_num_args() > 1) {
                      $args = func_get_args();
                Severity: Minor
                Found in include/classes/base.class.php - About 35 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 getExpectedTimePerBlock has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                  public function getExpectedTimePerBlock($type='network',$hashrate = 0){
                    if ($data = $this->memcache->get(__FUNCTION__)) return $data;
                
                    if ($this->bitcoin->can_connect() === true) {
                      if ($type == 'network') {
                Severity: Minor
                Found in include/classes/statistics.class.php - About 35 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 beforeSendPerformed has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function beforeSendPerformed(Swift_Events_SendEvent $evt)
                    {
                        $time = $this->getTimestamp();
                        if (!isset($this->_start)) {
                            $this->_start = $time;
                Severity: Minor
                Found in include/lib/swiftmailer/classes/Swift/Plugins/ThrottlerPlugin.php - About 35 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 queueMessage has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function queueMessage(Swift_Mime_Message $message)
                    {
                        $ser = serialize($message);
                        $fileName = $this->_path . '/' . $this->getRandomString(10);
                        for ($i = 0; $i < $this->_retryLimit; ++$i) {
                Severity: Minor
                Found in include/lib/swiftmailer/classes/Swift/FileSpool.php - About 35 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