lucliscio/fanKounter

View on GitHub

Showing 79 of 86 total issues

Function shouldCacheBeUpdated has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function shouldCacheBeUpdated()
    {
        // Load the cache at the first request
        if ($this->_cacheLoaded) {
            return false;
Severity: Minor
Found in src/libs/Browscap.php - About 45 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 (typeof q === OBJ_TYPE && q.length > 0) {
                                if (q.length === 2) {
                                    if (typeof q[1] == FUNC_TYPE) {
                                        // assign modified match
                                        this[q[0]] = q[1].call(this, match);
Severity: Major
Found in src/libs/js/ua-parser.js - About 45 mins to fix

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

    function _strlan_($__string,$__strip=FALSE,$__par1=FALSE,$__par2=FALSE,$__par3=FALSE,$__par4=FALSE){
    Severity: Minor
    Found in src/stats.php - About 45 mins to fix

      Function check_template has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function check_template( $tpl_name ){
      
              if( !isset($this->tpl['checked']) ){
      
                  $tpl_basename                       = basename( $tpl_name );                                                        // template basename
      Severity: Minor
      Found in src/libs/rain.tpl.class.php - About 45 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($aux__bcap["Browser"]!=$par__brname){
                              $__agent = $par__brname;
                          }
      Severity: Major
      Found in src/counter.php - About 45 mins to fix

        Function _domains_ has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

        function _domains_($__data){
         settype($__data,"array");
        
         $__domains=array("#?"=>(array_key_exists("#?",$__data))?$__data["#?"]:0,"#!"=>(array_key_exists("#!",$__data))?$__data["#!"]:0);
         unset($__data["#?"],$__data["#!"]);
        Severity: Minor
        Found in src/stats.php - About 45 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

                            while(count($dat__entry)>$cnf__last_entries){
                                ksort($dat__entry,SORT_NUMERIC);
                                reset($dat__entry);
                                unset($dat__entry[key($dat__entry)]);
                            }
        Severity: Major
        Found in src/counter.php - About 45 mins to fix

          Function _getUpdateMethod has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              protected function _getUpdateMethod()
              {
                  // Caches the result
                  if ($this->updateMethod === null) {
                      if ($this->localFile !== null) {
          Severity: Minor
          Found in src/libs/Browscap.php - About 45 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 compileFile has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              protected function compileFile( $tpl_basename, $tpl_basedir, $tpl_filename, $cache_dir, $compiled_filename ){
          Severity: Minor
          Found in src/libs/rain.tpl.class.php - About 35 mins to fix

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

                public function addProxySettings($server, $port = 3128, $wrapper = 'http', $username = null, $password = null)
            Severity: Minor
            Found in src/libs/Browscap.php - About 35 mins to fix

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

                  public function updateCache()
                  {
                      $lockfile = $this->cacheDir . 'cache.lock';
              
                      $lockRes = fopen($lockfile, 'w+');
              Severity: Minor
              Found in src/libs/Browscap.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 _fcopy_ has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

              function _fcopy_($__source,$__target){
                settype($__source,"string");
                settype($__target,"string");
              
                clearstatcache();
              Severity: Minor
              Found in src/sys.inc.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 _ls_ has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

              function _ls_($__dir="./",$__pattern="*.*"){
                settype($__dir,"string");
                settype($__pattern,"string");
              
                clearstatcache();
              Severity: Minor
              Found in src/sys.inc.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

              Avoid too many return statements within this method.
              Open

                      return 0;
              Severity: Major
              Found in src/libs/Browscap.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                        return '';
                Severity: Major
                Found in src/libs/Browscap.php - About 30 mins to fix

                  Function _max_hits_in_month_ has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                    function _max_hits_in_month_() {
                      global $aux__now;
                  
                      $__max=array("timestamp"=>$aux__now,"hits"=>0);
                  
                  Severity: Minor
                  Found in src/cal.inc.php - About 25 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 configure has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      static function configure( $setting, $value = null ){
                          if( is_array( $setting ) )
                              foreach( $setting as $key => $value )
                                  self::configure( $key, $value );
                          else if( property_exists( __CLASS__, $setting ) ){
                  Severity: Minor
                  Found in src/libs/rain.tpl.class.php - About 25 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 _unique_accs_ has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      function _unique_accs_(){
                          global $par__id;
                          global $cnf__mtime_unique_accs,$cnf__expire_on_midnight,$cnf__count_per_pages;
                          global $aux__now,$aux__ip,$aux__agent,$aux__location;
                  
                  
                  Severity: Minor
                  Found in src/counter.php - About 25 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 _flock_ has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function _flock_(){
                    global $par__id;
                    global $__lock_fid;
                  
                    if(FLOCK){
                  Severity: Minor
                  Found in src/sys.inc.php - About 25 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