lucliscio/fanKounter

View on GitHub

Showing 65 of 86 total issues

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

    public function clearProxySettings($wrapper = null)
    {
        $wrappers = isset($wrapper) ? array($wrapper) : array_keys($this->_streamContextOptions);

        $clearedWrappers = array();
Severity: Minor
Found in src/libs/Browscap.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 draw has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    function draw( $tpl_name, $return_string = false ){

        try {
            // compile the template if necessary and set the template filepath
            $this->check_template( $tpl_name );
Severity: Minor
Found in src/libs/rain.tpl.class.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 const_replace has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

    function const_replace( $html, $tag_left_delimiter, $tag_right_delimiter, $php_left_delimiter = null, $php_right_delimiter = null, $loop_level = null, $echo = null ){
Severity: Major
Found in src/libs/rain.tpl.class.php - About 50 mins to fix

    Method func_replace has 7 arguments (exceeds 4 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 ){
    Severity: Major
    Found in src/libs/rain.tpl.class.php - About 50 mins to fix

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

          function var_replace( $html, $tag_left_delimiter, $tag_right_delimiter, $php_left_delimiter = null, $php_right_delimiter = null, $loop_level = null, $echo = null ){
      Severity: Major
      Found in src/libs/rain.tpl.class.php - About 50 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                    while (!feof($remote_handler)) {
                                        $file .= fgets($remote_handler);
                                    }
        Severity: Major
        Found in src/libs/Browscap.php - About 45 mins to fix

          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
                        Severity
                        Category
                        Status
                        Source
                        Language