Showing 135 of 135 total issues

Function pathSeeker has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    protected function pathSeeker( $_path, $_url ) {
      $urlLength = count($_url);
      $cont = 0;
      $variables = [];
      $pathLength = count($_path);
Severity: Minor
Found in dist/jate/modules/Router/Router.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 jateErrorHandler has 56 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function jateErrorHandler($number, $message, $file, $line) {
    if (!(error_reporting() & $number)) {
      return false;
    }
    ob_end_clean();
Severity: Major
Found in dist/jate/functions/errorHandler.php - About 2 hrs to fix

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

      function fetchInSubFolder( $_dir = "./", $_function) {
        $temp = [];
        if (is_dir($_dir)) {
            if ($dirOpened = opendir($_dir)) {
                while (($file = readdir($dirOpened)) !== false)
    Severity: Minor
    Found in dist/jate/functions/folder.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

    Similar blocks of code found in 5 locations. Consider refactoring.
    Open

        public function queryInsert( $_query ) {
          if(!is_string($_query))
            throw new JException("Parameter must be a string.", 1);
          if($this->currentConnection == null)
            throw new JException("No connection selected.", 1);
    Severity: Major
    Found in dist/jate/modules/Query/Query.php and 4 other locations - About 1 hr to fix
    dist/jate/modules/Query/Query.php on lines 42..53
    dist/jate/modules/Query/Query.php on lines 66..77
    dist/jate/modules/Query/Query.php on lines 78..89
    dist/jate/modules/Query/Query.php on lines 90..101

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 108.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 5 locations. Consider refactoring.
    Open

        public function queryArray( $_query ) {
          if(!is_string($_query))
            throw new JException("Parameter must be a string.", 1);
          if($this->currentConnection == null)
            throw new JException("No connection selected.", 1);
    Severity: Major
    Found in dist/jate/modules/Query/Query.php and 4 other locations - About 1 hr to fix
    dist/jate/modules/Query/Query.php on lines 42..53
    dist/jate/modules/Query/Query.php on lines 54..65
    dist/jate/modules/Query/Query.php on lines 66..77
    dist/jate/modules/Query/Query.php on lines 90..101

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 108.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 5 locations. Consider refactoring.
    Open

        public function newTable( $_query ) {
          if(!is_string($_query))
            throw new JException("Parameter must be a string.", 1);
          if($this->currentConnection == null)
            throw new JException("No connection selected.", 1);
    Severity: Major
    Found in dist/jate/modules/Query/Query.php and 4 other locations - About 1 hr to fix
    dist/jate/modules/Query/Query.php on lines 42..53
    dist/jate/modules/Query/Query.php on lines 54..65
    dist/jate/modules/Query/Query.php on lines 66..77
    dist/jate/modules/Query/Query.php on lines 78..89

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 108.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 5 locations. Consider refactoring.
    Open

        public function query( $_query ) {
          if(!is_string($_query))
            throw new JException("Parameter must be a string.", 1);
          if($this->currentConnection == null)
            throw new JException("No connection selected.", 1);
    Severity: Major
    Found in dist/jate/modules/Query/Query.php and 4 other locations - About 1 hr to fix
    dist/jate/modules/Query/Query.php on lines 54..65
    dist/jate/modules/Query/Query.php on lines 66..77
    dist/jate/modules/Query/Query.php on lines 78..89
    dist/jate/modules/Query/Query.php on lines 90..101

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 108.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 5 locations. Consider refactoring.
    Open

        public function queryFetch( $_query ) {
          if(!is_string($_query))
            throw new JException("Parameter must be a string.", 1);
          if($this->currentConnection == null)
            throw new JException("No connection selected.", 1);
    Severity: Major
    Found in dist/jate/modules/Query/Query.php and 4 other locations - About 1 hr to fix
    dist/jate/modules/Query/Query.php on lines 42..53
    dist/jate/modules/Query/Query.php on lines 54..65
    dist/jate/modules/Query/Query.php on lines 78..89
    dist/jate/modules/Query/Query.php on lines 90..101

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 108.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

        public function getPage() {
          $parameters = [];
          $pageSelected = null;
          foreach ($this->pages as $page) {
            $urlParameters = $this->pathSeeker(explode("/", $page[0]), $this->url);
    Severity: Minor
    Found in dist/jate/modules/Router/Router.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

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

      function arrayDump( $_array, $_name = "Array", $_tab = "  " ) {
        $position = preg_replace('/  /', '', $_tab, 1);
        echo "$position<span style=\"color:rgb(230,0,0)\">$_name:</span><br>";
        foreach ($_array as $k => $i)
          if(is_array($i))
    Severity: Minor
    Found in dist/jate/functions/array.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 getRequire has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function getRequire( $_function, $_extenction) {
          $temp = [];
          $filesRequired = $this->getFilesRequired();
          $files         = $this->getFiles();
          foreach ($filesRequired as $i)
    Severity: Minor
    Found in dist/jate/modules/Html/Html.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

    Avoid deeply nested control flow statements.
    Open

                      if($_function($file))
                        array_push($temp,$file);
    Severity: Major
    Found in dist/jate/functions/folder.php - About 45 mins to fix

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

          protected function setConnection ( $_srv, $_db, $_usr, $_pass, $_type ) {
      Severity: Minor
      Found in dist/jate/modules/Connection/Connection.php - About 35 mins to fix

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

            public function __construct( $_path ) {
              if(!is_string($_path))
                throw new JException("Path must be a string.");
              if(!file_exists($_path))
                throw new JException("File [$_path] not found.");
        Severity: Minor
        Found in dist/jate/modules/JConfig/JConfig.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 arrayDepth has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

          function arrayDepth( $_array ) {
            $maxDepth = 1;
            foreach ($_array as $value) {
              if (is_array($value)) {
                $depth = arrayDepth($value) + 1;
        Severity: Minor
        Found in dist/jate/functions/array.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 travelStringArray has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

          function travelStringArray ( $_array, $_function ) {
            if (is_array($_array)) {
              foreach ($_array as $k => $v) {
                $_array[$k] = travelStringArray($v, $_function);
              }
        Severity: Minor
        Found in dist/jate/functions/array.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 requireComponents has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

          function requireComponents( $_path, $_local = true ) {
            $path = getJFolder($_path, $_local, debug_backtrace());
            if(file_exists($path)) {
              $files = subFolderFile($path);
              foreach ($files as $i)
        Severity: Minor
        Found in dist/jate/functions/requirer.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

        Missing class import via use statement (line '53', column '19').
        Open

                throw new InvalidArgumentException("Parameter value must be a string.");
        Severity: Minor
        Found in dist/jate/modules/Html/Html.php by phpmd

        MissingImport

        Since: 2.7.0

        Importing all external classes in a file through use statements makes them clearly visible.

        Example

        function make() {
            return new \stdClass();
        }

        Source http://phpmd.org/rules/cleancode.html#MissingImport

        Missing class import via use statement (line '16', column '21').
        Open

                  throw new JException($e->getMessage());

        MissingImport

        Since: 2.7.0

        Importing all external classes in a file through use statements makes them clearly visible.

        Example

        function make() {
            return new \stdClass();
        }

        Source http://phpmd.org/rules/cleancode.html#MissingImport

        Missing class import via use statement (line '23', column '33').
        Open

                  $this->database = new PostgresqlAdapter($_srv, $_db, $_usr, $_pass);

        MissingImport

        Since: 2.7.0

        Importing all external classes in a file through use statements makes them clearly visible.

        Example

        function make() {
            return new \stdClass();
        }

        Source http://phpmd.org/rules/cleancode.html#MissingImport

        Severity
        Category
        Status
        Source
        Language