samsonos/php_core

View on GitHub

Showing 51 of 51 total issues

Method date_format_ru has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function date_format_ru($date)
{
    $date = strtotime($date);
    $day = date("d", $date);
    $month_en = date("F", $date);
Severity: Minor
Found in src/Utils2.php - About 1 hr to fix

    Function render has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        public function render($view, $data = array())
        {
            // TODO: Make rendering as external system, to split up these 3 rendering options
    
            // Объявить ассоциативный массив переменных в данном контексте
    Severity: Minor
    Found in src/Core.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 dir has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public static function dir($path, $type = null, $modifier = '', & $result = array(), $max_level = NULL, $level = 0, $restrict = array('.git', '.svn', '.hg', '.settings'))
        {
            // Если установлено ограничение на глубину - выйдем
            if (isset($max_level) && $level > $max_level) return $result;
    
    
    Severity: Minor
    Found in src/File.php - About 1 hr to fix

      Function array_power_set has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

      function array_power_set(array $array, $size = null)
      {
          // initialize by adding the empty set
          $results = array(array());
      
      
      Severity: Minor
      Found in src/Utils2.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 time_difference has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function time_difference($enddate, $startdate = null)
      {
          // Get current timestamp
          if (!isset($startdate)) $startdate = time();
          else $startdate = strtotime($startdate);
      Severity: Minor
      Found in src/Utils2.php - About 1 hr to fix

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

        function & debug_parse_args(array $args)
        {
            // Соберем сюда описание аргументов функции
            $result = array();
        
        
        Severity: Minor
        Found in src/Utils2.php - About 1 hr to fix

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

              public static function load($class)
              {
                  // Get just class name without ns
                  $className = self::getOnlyClass($class);
                  // Get just ns without class name
          Severity: Minor
          Found in src/deprecated/AutoLoader.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 output has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

              public function output()
              {
                  // Получим последнюю ошибку системы
                  $lerror = error_get_last();
          
          
          Severity: Minor
          Found in src/deprecated/Error.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 v has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

          function v($name, $realName = NULL)
          {
              // Получим указатель на текущий модуль
              $m = m();
          
          
          Severity: Minor
          Found in src/View.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

          Method dir has 7 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              public static function dir($path, $type = null, $modifier = '', & $result = array(), $max_level = NULL, $level = 0, $restrict = array('.git', '.svn', '.hg', '.settings'))
          Severity: Major
          Found in src/File.php - About 50 mins to fix

            Method handler has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                public function handler($errno, $error_msg, $errfile = NULL, $errline = NULL, $errcontext = NULL, $backtrace = NULL)
            Severity: Minor
            Found in src/deprecated/Error.php - About 45 mins to fix

              Method debug_to_string has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              function debug_to_string($errno = NULL, $file = NULL, $line = NULL, $class = NULL, $function = NULL, $args = NULL)
              Severity: Minor
              Found in src/Utils2.php - About 45 mins to fix

                Method toError has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    private function toError($errno, $desc, $error_msg, $errfile = NULL, $errline = NULL, $class = NULL)
                Severity: Minor
                Found in src/deprecated/Error.php - About 45 mins to fix

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

                  function vimg($src, $id = '', $class = '', $alt = '', $dummy = null)
                  Severity: Minor
                  Found in src/View.php - About 35 mins to fix

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

                    function isval($name, $value = null, $success = null, $failure = null, $inverse = false)
                    Severity: Minor
                    Found in src/View.php - About 35 mins to fix

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

                      function mail_send($to, $from = 'info@samsonos.com', $message = '', $subject = '', $from_user = '')
                      Severity: Minor
                      Found in src/Utils2.php - About 35 mins to fix

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

                        function vhref($name, $href = null, $class = null, $id = null, $title = null)
                        Severity: Minor
                        Found in src/View.php - About 35 mins to fix

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

                          function debug_parse_markers($pattern, array & $args = NULL)
                          {
                              // Текущий номер аргумента для подмены
                              $a_ind = 0;
                          
                          
                          Severity: Minor
                          Found in src/Utils2.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 parseURL has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public static function parseURL(array &$args, $leaveDefaultLocale = true)
                              {
                                  // Iterate defined site locales
                                  foreach (self::$locales as $locale) {
                                      // Search locale string as URL argument
                          Severity: Minor
                          Found in src/SamsonLocale.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 set has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public static function set(array $available_locales)
                              {
                                  // Переберем локализации
                                  foreach ($available_locales as $locale) {
                                      $_locale = strtolower($locale);
                          Severity: Minor
                          Found in src/SamsonLocale.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