MPOS/php-mpos

View on GitHub

Showing 889 of 1,089 total issues

Method doLists has 55 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function doLists($text) {
    #
    # Form HTML ordered (numbered) and unordered (bulleted) lists.
    #
        $less_than_tab = $this->tab_width - 1;
Severity: Major
Found in include/lib/Michelf/Markdown.php - About 2 hrs to fix

    Smarty_CacheResource_KeyValueStore has 21 functions (exceeds 20 allowed). Consider refactoring.
    Open

    abstract class Smarty_CacheResource_KeyValueStore extends Smarty_CacheResource
    {
        /**
         * cache for contents
         * @var array
    Severity: Minor
    Found in include/smarty/libs/sysplugins/smarty_cacheresource_keyvaluestore.php - About 2 hrs to fix

      Swift_DependencyContainer has 21 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class Swift_DependencyContainer
      {
          /** Constant for literal value types */
          const TYPE_VALUE = 0x0001;
      
      
      Severity: Minor
      Found in include/lib/swiftmailer/classes/Swift/DependencyContainer.php - About 2 hrs to fix

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

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

          Method beforeSendPerformed has 54 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function beforeSendPerformed(Swift_Events_SendEvent $evt)
              {
                  $message = $evt->getMessage();
                  $this->_restoreMessage($message);
                  $to = array_keys($message->getTo());
          Severity: Major
          Found in include/lib/swiftmailer/classes/Swift/Plugins/DecoratorPlugin.php - About 2 hrs to fix

            Method yylex2 has 53 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

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

              Function smarty_modifier_relative_date has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
              Open

              function smarty_modifier_relative_date($timestamp, $days = false, $format = "M j, Y") {
                
                if (!is_numeric($timestamp)) {
                  // It's not a time stamp, so try to convert it...
                  $timestamp = strtotime($timestamp);
              Severity: Minor
              Found in include/smarty/libs/plugins/modifier.relative_date.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 processNocacheCode has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function processNocacheCode($content, $is_code)
                  {
                      // If the template is not evaluated and we have a nocache section and or a nocache tag
                      if ($is_code && !empty($content)) {
                          // generate replacement code

              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 16 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function compile($args, $compiler, $parameter, $tag, $function)
                  {
                      if (!isset($tag[5]) || substr($tag, -5) != 'close') {
                          // opening tag of block plugin
                          // check and get attributes

              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 16 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function compile($args, $compiler, $parameter, $tag, $method)
                  {
                      if (!isset($tag[5]) || substr($tag, -5) != 'close') {
                          // opening tag of block plugin
                          // check and get attributes

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

                public function storeUptimeRobotStatus() {
                  if ($api_keys = $this->setting->getValue('monitoring_uptimerobot_api_keys')) {
                    $aJSONData = array();
                    $url = 'https://api.uptimerobot.com';
                    $aMonitors = explode(',', $api_keys);
              Severity: Minor
              Found in include/classes/monitoring.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 findUpstreamShare has a Cognitive Complexity of 16 (exceeds 5 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: Minor
              Found in include/classes/share.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 checkHttpHeadersForMobile has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function checkHttpHeadersForMobile()
                  {
              
                      foreach($this->getMobileHeaders() as $mobileHeader => $matchType){
                          if( isset($this->httpHeaders[$mobileHeader]) ){
              Severity: Minor
              Found in include/lib/Mobile_Detect.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 send has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function send(Swift_Mime_Message $message, &$failedRecipients = null)
                  {
                      $failedRecipients = (array) $failedRecipients;
                      $command = $this->getCommand();
                      $buffer = $this->getBuffer();
              Severity: Minor
              Found in include/lib/swiftmailer/classes/Swift/Transport/SendmailTransport.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

              Method load has 52 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public static function load(Smarty $smarty, $type)
                  {
                      // try smarty's cache
                      if (isset($smarty->_resource_handlers[$type])) {
                          return $smarty->_resource_handlers[$type];
              Severity: Major
              Found in include/smarty/libs/sysplugins/smarty_resource.php - About 2 hrs to fix

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

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

                  Method getLastBlocksbyTime has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    function getLastBlocksbyTime() {
                      $this->debug->append("STA " . __METHOD__, 4);
                      if ($data = $this->memcache->get(__FUNCTION__)) return $data;
                      $stmt = $this->mysqli->prepare("
                        SELECT
                  Severity: Major
                  Found in include/classes/statistics.class.php - About 2 hrs to fix

                    Method read has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function read($length)
                        {
                            if ($this->_currentPos>=$this->_charCount) {
                              return false;
                            }

                      File smarty_internal_compile_block.php has 252 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      <?php
                      
                      /**
                       * Smarty Internal Plugin Compile Block
                       *
                      Severity: Minor
                      Found in include/smarty/libs/sysplugins/smarty_internal_compile_block.php - About 2 hrs to fix

                        Method smarty_function_html_checkboxes_output has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function smarty_function_html_checkboxes_output($name, $value, $output, $selected, $extra, $separator, $labels, $label_ids, $escape=true)
                        {
                            $_output = '';
                        
                            if (is_object($value)) {
                        Severity: Major
                        Found in include/smarty/libs/plugins/function.html_checkboxes.php - About 2 hrs to fix
                          Severity
                          Category
                          Status
                          Source
                          Language