lucliscio/fanKounter

View on GitHub

Showing 65 of 86 total issues

File Browscap.php has 811 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

namespace phpbrowscap;

/**
Severity: Major
Found in src/libs/Browscap.php - About 1 day to fix

    File ua-parser.js has 665 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /////////////////////////////////////////////////////////////////////////////////
    /* UAParser.js v1.0.32
       Copyright © 2012-2021 Faisal Salman <f@faisalman.com>
       MIT License *//*
       Detect Browser, Engine, OS, CPU, and Device type/model from User-Agent data.
    Severity: Major
    Found in src/libs/js/ua-parser.js - About 1 day to fix

      Function getBrowser has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
      Open

          public function getBrowser($user_agent = null, $return_array = false)
          {
              if ($this->shouldCacheBeUpdated()) {
                  try {
                      $this->updateCache();
      Severity: Minor
      Found in src/libs/Browscap.php - About 7 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 createCacheNewWay has 107 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function createCacheNewWay($iniContent)
          {
              $patternPositions = array();
      
              // get all patterns from the ini file in the correct order,
      Severity: Major
      Found in src/libs/Browscap.php - About 4 hrs to fix

        Function createCacheNewWay has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
        Open

            protected function createCacheNewWay($iniContent)
            {
                $patternPositions = array();
        
                // get all patterns from the ini file in the correct order,
        Severity: Minor
        Found in src/libs/Browscap.php - About 4 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

        File counter.php has 328 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php 
        /* 
         * counter.php
         *                                       __       HZKnight free PHP Scripts    _    vs 5.1
         *                                      / _| __ _ _ __   /\ /\___  _   _ _ __ | |_ ___ _ __
        Severity: Minor
        Found in src/counter.php - About 3 hrs to fix

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

           public function __construct($__url){
            settype($__url,"string");
          
            global $inf__engine,$inf__keyban;
          
          Severity: Minor
          Found in src/url.inc.php - About 3 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 _getRemoteData has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
          Open

              protected function _getRemoteData($url)
              {
                  ini_set('user_agent', $this->_getUserAgent());
          
                  switch ($this->_getUpdateMethod()) {
          Severity: Minor
          Found in src/libs/Browscap.php - About 3 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 getBrowser has 87 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function getBrowser($user_agent = null, $return_array = false)
              {
                  if ($this->shouldCacheBeUpdated()) {
                      try {
                          $this->updateCache();
          Severity: Major
          Found in src/libs/Browscap.php - About 3 hrs to fix

            Browscap has 28 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class Browscap
            {
                /**
                 * Current version of the class.
                 */
            Severity: Minor
            Found in src/libs/Browscap.php - About 3 hrs to fix

              Method _getRemoteData has 82 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  protected function _getRemoteData($url)
                  {
                      ini_set('user_agent', $this->_getUserAgent());
              
                      switch ($this->_getUpdateMethod()) {
              Severity: Major
              Found in src/libs/Browscap.php - About 3 hrs to fix

                Method _panel1_ has 80 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function _panel1_(){
                    global $cnf__last_entries;
                    global $dat__entry;
                    global $inf__country;
                
                
                Severity: Major
                Found in src/stats.php - About 3 hrs to fix

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

                   public function URL($__url){
                    settype($__url,"string");
                  
                    $__url_v=array("prot"=>"","host"=>"","port"=>"","path"=>"","page"=>"","para"=>"");
                  
                  Severity: Minor
                  Found in src/url.inc.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 _getRemoteIniFile has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                  Open

                      protected function _getRemoteIniFile($url, $path)
                      {
                          // local and remote file are the same, no update possible
                          if ($url == $path) {
                              return false;
                  Severity: Minor
                  Found in src/libs/Browscap.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 UAParser has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      var UAParser = function (ua, extensions) {
                  
                          if (typeof ua === OBJ_TYPE) {
                              extensions = ua;
                              ua = undefined;
                  Severity: Major
                  Found in src/libs/js/ua-parser.js - About 2 hrs to fix

                    Method URL has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                     public function URL($__url){
                      settype($__url,"string");
                    
                      $__url_v=array("prot"=>"","host"=>"","port"=>"","path"=>"","page"=>"","para"=>"");
                    
                    Severity: Major
                    Found in src/url.inc.php - About 2 hrs to fix

                      Method createCacheOldWay has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          protected function createCacheOldWay($iniContent, $actLikeNewVersion = false)
                          {
                              $browsers = parse_ini_string($iniContent, true, INI_SCANNER_RAW);
                      
                              if ($actLikeNewVersion) {
                      Severity: Major
                      Found in src/libs/Browscap.php - About 2 hrs to fix

                        Function createCacheOldWay has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                        Open

                            protected function createCacheOldWay($iniContent, $actLikeNewVersion = false)
                            {
                                $browsers = parse_ini_string($iniContent, true, INI_SCANNER_RAW);
                        
                                if ($actLikeNewVersion) {
                        Severity: Minor
                        Found in src/libs/Browscap.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 _graph_ has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function _graph_($__data,$__type,$__title,$__header1,$__header2,$__header3,$__colsize1,$__colsize2,$__colsize3,$__unknownitem,$__strcut,$__restrict){
                         settype($__data,"array");
                         settype($__type,"string");
                         settype($__title,"string");
                         settype($__header1,"string");
                        Severity: Minor
                        Found in src/stats.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 func_replace has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                        Open

                            function func_replace( $html, $tag_left_delimiter, $tag_right_delimiter, $php_left_delimiter = null, $php_right_delimiter = null, $loop_level = null, $echo = null ){
                        
                                preg_match_all( '/' . '\{\#{0,1}(\"{0,1}.*?\"{0,1})(\|\w.*?)\#{0,1}\}' . '/', $html, $matches );
                        
                                for( $i=0, $n=count($matches[0]); $i<$n; $i++ ){
                        Severity: Minor
                        Found in src/libs/rain.tpl.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

                        Severity
                        Category
                        Status
                        Source
                        Language