XoopsModules25x/userlog

View on GitHub
class/phpbrowscap/Browscap.php

Summary

Maintainability
F
1 wk
Test Coverage

getBrowser accesses the super-global variable $_SERVER.
Open

    public function getBrowser($user_agent = null, $return_array = false)
    {
        if ($this->shouldCacheBeUpdated()) {
            try {
                $this->updateCache();
Severity: Minor
Found in class/phpbrowscap/Browscap.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

getBrowser accesses the super-global variable $_SERVER.
Open

    public function getBrowser($user_agent = null, $return_array = false)
    {
        if ($this->shouldCacheBeUpdated()) {
            try {
                $this->updateCache();
Severity: Minor
Found in class/phpbrowscap/Browscap.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

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

<?php

namespace phpbrowscap;

use Exception as BaseException;
Severity: Major
Found in class/phpbrowscap/Browscap.php - 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 class/phpbrowscap/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

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

        protected function createCacheNewWay($iniContent)
        {
            $patternPositions = [];
    
            // get all patterns from the ini file in the correct order,
    Severity: Minor
    Found in class/phpbrowscap/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

    Method createCacheNewWay has 101 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

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

      Function _getRemoteData has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function _getRemoteData($url)
          {
              ini_set('user_agent', $this->_getUserAgent());
      
              switch ($this->_getUpdateMethod()) {
      Severity: Minor
      Found in class/phpbrowscap/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 88 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 class/phpbrowscap/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 class/phpbrowscap/Browscap.php - About 3 hrs to fix

          The class Browscap has an overall complexity of 167 which is very high. The configured complexity threshold is 50.
          Open

          class Browscap
          {
              /**
               * Current version of the class.
               */
          Severity: Minor
          Found in class/phpbrowscap/Browscap.php by phpmd

          Method _getRemoteData has 79 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 class/phpbrowscap/Browscap.php - About 3 hrs to fix

            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 class/phpbrowscap/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 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 class/phpbrowscap/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

            Method _pregUnQuote has 56 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                protected function _pregUnQuote($pattern, $matches)
                {
                    // list of escaped characters: http://www.php.net/manual/en/function.preg-quote.php
                    // to properly unescape '?' which was changed to '.', I replace '\.' (real dot) with '\?',
                    // then change '.' to '?' and then '\?' to '.'.
            Severity: Major
            Found in class/phpbrowscap/Browscap.php - About 2 hrs to fix

              Method createCacheOldWay has 53 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 class/phpbrowscap/Browscap.php - About 2 hrs to fix

                Method _getRemoteIniFile has 43 lines of code (exceeds 25 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 class/phpbrowscap/Browscap.php - About 1 hr to fix

                  Method updateCache has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function updateCache()
                      {
                          $lockfile = $this->cacheDir . 'cache.lock';
                  
                          $lockRes = fopen($lockfile, 'w+');
                  Severity: Minor
                  Found in class/phpbrowscap/Browscap.php - About 1 hr to fix

                    The class Browscap has 22 fields. Consider redesigning Browscap to keep the number of fields under 15.
                    Open

                    class Browscap
                    {
                        /**
                         * Current version of the class.
                         */
                    Severity: Minor
                    Found in class/phpbrowscap/Browscap.php by phpmd

                    TooManyFields

                    Since: 0.1

                    Classes that have too many fields could be redesigned to have fewer fields, possibly through some nested object grouping of some of the information. For example, a class with city/state/zip fields could instead have one Address field.

                    Example

                    class Person {
                       protected $one;
                       private $two;
                       private $three;
                       [... many more fields ...]
                    }

                    Source https://phpmd.org/rules/codesize.html#toomanyfields

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

                        protected function _array2string($array)
                        {
                            $content = "array(\n";
                    
                            foreach ($array as $key => $value) {
                    Severity: Minor
                    Found in class/phpbrowscap/Browscap.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 clearProxySettings has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function clearProxySettings($wrapper = null)
                        {
                            $wrappers = isset($wrapper) ? [$wrapper] : array_keys($this->_streamContextOptions);
                    
                            $clearedWrappers = [];
                    Severity: Minor
                    Found in class/phpbrowscap/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 _getUpdateMethod has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                        protected function _getUpdateMethod()
                        {
                            // Caches the result
                            if (null === $this->updateMethod) {
                                if (null !== $this->localFile) {
                    Severity: Minor
                    Found in class/phpbrowscap/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

                    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 class/phpbrowscap/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

                                                while (!feof($remote_handler)) {
                                                    $file .= fgets($remote_handler);
                                                }
                    Severity: Major
                    Found in class/phpbrowscap/Browscap.php - About 45 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 class/phpbrowscap/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 class/phpbrowscap/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

                        Avoid too many return statements within this method.
                        Open

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

                          Avoid too many return statements within this method.
                          Open

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

                            The method createCacheNewWay() has 143 lines of code. Current threshold is set to 100. Avoid really long methods.
                            Open

                                protected function createCacheNewWay($iniContent)
                                {
                                    $patternPositions = [];
                            
                                    // get all patterns from the ini file in the correct order,
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            The method _getRemoteData() has 107 lines of code. Current threshold is set to 100. Avoid really long methods.
                            Open

                                protected function _getRemoteData($url)
                                {
                                    ini_set('user_agent', $this->_getUserAgent());
                            
                                    switch ($this->_getUpdateMethod()) {
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            The method createCacheNewWay() has an NPath complexity of 2400. The configured NPath complexity threshold is 200.
                            Open

                                protected function createCacheNewWay($iniContent)
                                {
                                    $patternPositions = [];
                            
                                    // get all patterns from the ini file in the correct order,
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            NPathComplexity

                            Since: 0.1

                            The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

                            Example

                            class Foo {
                                function bar() {
                                    // lots of complicated code
                                }
                            }

                            Source https://phpmd.org/rules/codesize.html#npathcomplexity

                            The method getBrowser() has 125 lines of code. Current threshold is set to 100. Avoid really long methods.
                            Open

                                public function getBrowser($user_agent = null, $return_array = false)
                                {
                                    if ($this->shouldCacheBeUpdated()) {
                                        try {
                                            $this->updateCache();
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            The method getBrowser() has an NPath complexity of 148176. The configured NPath complexity threshold is 200.
                            Open

                                public function getBrowser($user_agent = null, $return_array = false)
                                {
                                    if ($this->shouldCacheBeUpdated()) {
                                        try {
                                            $this->updateCache();
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            NPathComplexity

                            Since: 0.1

                            The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

                            Example

                            class Foo {
                                function bar() {
                                    // lots of complicated code
                                }
                            }

                            Source https://phpmd.org/rules/codesize.html#npathcomplexity

                            The class Browscap has 1424 lines of code. Current threshold is 1000. Avoid really long classes.
                            Open

                            class Browscap
                            {
                                /**
                                 * Current version of the class.
                                 */
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            The method _getRemoteIniFile() has an NPath complexity of 576. The configured NPath complexity threshold is 200.
                            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 class/phpbrowscap/Browscap.php by phpmd

                            NPathComplexity

                            Since: 0.1

                            The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

                            Example

                            class Foo {
                                function bar() {
                                    // lots of complicated code
                                }
                            }

                            Source https://phpmd.org/rules/codesize.html#npathcomplexity

                            The method createCacheNewWay() has a Cyclomatic Complexity of 17. The configured cyclomatic complexity threshold is 10.
                            Open

                                protected function createCacheNewWay($iniContent)
                                {
                                    $patternPositions = [];
                            
                                    // get all patterns from the ini file in the correct order,
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CyclomaticComplexity

                            Since: 0.1

                            Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

                            Example

                            // Cyclomatic Complexity = 11
                            class Foo {
                            1   public function example() {
                            2       if ($a == $b) {
                            3           if ($a1 == $b1) {
                                            fiddle();
                            4           } elseif ($a2 == $b2) {
                                            fiddle();
                                        } else {
                                            fiddle();
                                        }
                            5       } elseif ($c == $d) {
                            6           while ($c == $d) {
                                            fiddle();
                                        }
                            7        } elseif ($e == $f) {
                            8           for ($n = 0; $n < $h; $n++) {
                                            fiddle();
                                        }
                                    } else {
                                        switch ($z) {
                            9               case 1:
                                                fiddle();
                                                break;
                            10              case 2:
                                                fiddle();
                                                break;
                            11              case 3:
                                                fiddle();
                                                break;
                                            default:
                                                fiddle();
                                                break;
                                        }
                                    }
                                }
                            }

                            Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

                            The method _getRemoteIniFile() has a Cyclomatic Complexity of 13. The configured cyclomatic complexity threshold is 10.
                            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 class/phpbrowscap/Browscap.php by phpmd

                            CyclomaticComplexity

                            Since: 0.1

                            Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

                            Example

                            // Cyclomatic Complexity = 11
                            class Foo {
                            1   public function example() {
                            2       if ($a == $b) {
                            3           if ($a1 == $b1) {
                                            fiddle();
                            4           } elseif ($a2 == $b2) {
                                            fiddle();
                                        } else {
                                            fiddle();
                                        }
                            5       } elseif ($c == $d) {
                            6           while ($c == $d) {
                                            fiddle();
                                        }
                            7        } elseif ($e == $f) {
                            8           for ($n = 0; $n < $h; $n++) {
                                            fiddle();
                                        }
                                    } else {
                                        switch ($z) {
                            9               case 1:
                                                fiddle();
                                                break;
                            10              case 2:
                                                fiddle();
                                                break;
                            11              case 3:
                                                fiddle();
                                                break;
                                            default:
                                                fiddle();
                                                break;
                                        }
                                    }
                                }
                            }

                            Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

                            The method createCacheOldWay() has a Cyclomatic Complexity of 10. The configured cyclomatic complexity threshold is 10.
                            Open

                                protected function createCacheOldWay($iniContent, $actLikeNewVersion = false)
                                {
                                    $browsers = parse_ini_string($iniContent, true, INI_SCANNER_RAW);
                            
                                    if ($actLikeNewVersion) {
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CyclomaticComplexity

                            Since: 0.1

                            Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

                            Example

                            // Cyclomatic Complexity = 11
                            class Foo {
                            1   public function example() {
                            2       if ($a == $b) {
                            3           if ($a1 == $b1) {
                                            fiddle();
                            4           } elseif ($a2 == $b2) {
                                            fiddle();
                                        } else {
                                            fiddle();
                                        }
                            5       } elseif ($c == $d) {
                            6           while ($c == $d) {
                                            fiddle();
                                        }
                            7        } elseif ($e == $f) {
                            8           for ($n = 0; $n < $h; $n++) {
                                            fiddle();
                                        }
                                    } else {
                                        switch ($z) {
                            9               case 1:
                                                fiddle();
                                                break;
                            10              case 2:
                                                fiddle();
                                                break;
                            11              case 3:
                                                fiddle();
                                                break;
                                            default:
                                                fiddle();
                                                break;
                                        }
                                    }
                                }
                            }

                            Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

                            The method _getRemoteData() has a Cyclomatic Complexity of 19. The configured cyclomatic complexity threshold is 10.
                            Open

                                protected function _getRemoteData($url)
                                {
                                    ini_set('user_agent', $this->_getUserAgent());
                            
                                    switch ($this->_getUpdateMethod()) {
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CyclomaticComplexity

                            Since: 0.1

                            Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

                            Example

                            // Cyclomatic Complexity = 11
                            class Foo {
                            1   public function example() {
                            2       if ($a == $b) {
                            3           if ($a1 == $b1) {
                                            fiddle();
                            4           } elseif ($a2 == $b2) {
                                            fiddle();
                                        } else {
                                            fiddle();
                                        }
                            5       } elseif ($c == $d) {
                            6           while ($c == $d) {
                                            fiddle();
                                        }
                            7        } elseif ($e == $f) {
                            8           for ($n = 0; $n < $h; $n++) {
                                            fiddle();
                                        }
                                    } else {
                                        switch ($z) {
                            9               case 1:
                                                fiddle();
                                                break;
                            10              case 2:
                                                fiddle();
                                                break;
                            11              case 3:
                                                fiddle();
                                                break;
                                            default:
                                                fiddle();
                                                break;
                                        }
                                    }
                                }
                            }

                            Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

                            The method getBrowser() has a Cyclomatic Complexity of 25. The configured cyclomatic complexity threshold is 10.
                            Open

                                public function getBrowser($user_agent = null, $return_array = false)
                                {
                                    if ($this->shouldCacheBeUpdated()) {
                                        try {
                                            $this->updateCache();
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CyclomaticComplexity

                            Since: 0.1

                            Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

                            Example

                            // Cyclomatic Complexity = 11
                            class Foo {
                            1   public function example() {
                            2       if ($a == $b) {
                            3           if ($a1 == $b1) {
                                            fiddle();
                            4           } elseif ($a2 == $b2) {
                                            fiddle();
                                        } else {
                                            fiddle();
                                        }
                            5       } elseif ($c == $d) {
                            6           while ($c == $d) {
                                            fiddle();
                                        }
                            7        } elseif ($e == $f) {
                            8           for ($n = 0; $n < $h; $n++) {
                                            fiddle();
                                        }
                                    } else {
                                        switch ($z) {
                            9               case 1:
                                                fiddle();
                                                break;
                            10              case 2:
                                                fiddle();
                                                break;
                            11              case 3:
                                                fiddle();
                                                break;
                                            default:
                                                fiddle();
                                                break;
                                        }
                                    }
                                }
                            }

                            Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

                            The method getBrowser has a boolean flag argument $return_array, which is a certain sign of a Single Responsibility Principle violation.
                            Open

                                public function getBrowser($user_agent = null, $return_array = false)
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            BooleanArgumentFlag

                            Since: 1.4.0

                            A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

                            Example

                            class Foo {
                                public function bar($flag = true) {
                                }
                            }

                            Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

                            Remove error control operator '@' on line 603.
                            Open

                                public function updateCache()
                                {
                                    $lockfile = $this->cacheDir . 'cache.lock';
                            
                                    $lockRes = fopen($lockfile, 'w+');
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            ErrorControlOperator

                            Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

                            Example

                            function foo($filePath) {
                                $file = @fopen($filPath); // hides exceptions
                                $key = @$array[$notExistingKey]; // assigns null to $key
                            }

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

                            Remove error control operator '@' on line 604.
                            Open

                                public function updateCache()
                                {
                                    $lockfile = $this->cacheDir . 'cache.lock';
                            
                                    $lockRes = fopen($lockfile, 'w+');
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            ErrorControlOperator

                            Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

                            Example

                            function foo($filePath) {
                                $file = @fopen($filPath); // hides exceptions
                                $key = @$array[$notExistingKey]; // assigns null to $key
                            }

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

                            The method _getStreamContext has a boolean flag argument $recreate, which is a certain sign of a Single Responsibility Principle violation.
                            Open

                                protected function _getStreamContext($recreate = false)
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            BooleanArgumentFlag

                            Since: 1.4.0

                            A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

                            Example

                            class Foo {
                                public function bar($flag = true) {
                                }
                            }

                            Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

                            Remove error control operator '@' on line 605.
                            Open

                                public function updateCache()
                                {
                                    $lockfile = $this->cacheDir . 'cache.lock';
                            
                                    $lockRes = fopen($lockfile, 'w+');
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            ErrorControlOperator

                            Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

                            Example

                            function foo($filePath) {
                                $file = @fopen($filPath); // hides exceptions
                                $key = @$array[$notExistingKey]; // assigns null to $key
                            }

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

                            The method createCacheOldWay has a boolean flag argument $actLikeNewVersion, which is a certain sign of a Single Responsibility Principle violation.
                            Open

                                protected function createCacheOldWay($iniContent, $actLikeNewVersion = false)
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            BooleanArgumentFlag

                            Since: 1.4.0

                            A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

                            Example

                            class Foo {
                                public function bar($flag = true) {
                                }
                            }

                            Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

                            Remove error control operator '@' on line 598.
                            Open

                                public function updateCache()
                                {
                                    $lockfile = $this->cacheDir . 'cache.lock';
                            
                                    $lockRes = fopen($lockfile, 'w+');
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            ErrorControlOperator

                            Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

                            Example

                            function foo($filePath) {
                                $file = @fopen($filPath); // hides exceptions
                                $key = @$array[$notExistingKey]; // assigns null to $key
                            }

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

                            The method _getRemoteIniFile uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                            Open

                                    } else {
                                        // Test writability by creating a file only if one already doesn't exist, so we can safely delete it after
                                        // the test.
                                        $test_file = fopen($path, 'a');
                                        if ($test_file) {
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            ElseExpression

                            Since: 1.4.0

                            An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                            Example

                            class Foo
                            {
                                public function bar($flag)
                                {
                                    if ($flag) {
                                        // one branch
                                    } else {
                                        // another branch
                                    }
                                }
                            }

                            Source https://phpmd.org/rules/cleancode.html#elseexpression

                            The method updateCache uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                            Open

                                    } else {
                                        $url = $this->remoteIniUrl;
                                    }
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            ElseExpression

                            Since: 1.4.0

                            An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                            Example

                            class Foo
                            {
                                public function bar($flag)
                                {
                                    if ($flag) {
                                        // one branch
                                    } else {
                                        // another branch
                                    }
                                }
                            }

                            Source https://phpmd.org/rules/cleancode.html#elseexpression

                            The method _getRemoteIniFile uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                            Open

                                        } else {
                                            $remote_tmstp = $this->_getRemoteMTime();
                                        }
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            ElseExpression

                            Since: 1.4.0

                            An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                            Example

                            class Foo
                            {
                                public function bar($flag)
                                {
                                    if ($flag) {
                                        // one branch
                                    } else {
                                        // another branch
                                    }
                                }
                            }

                            Source https://phpmd.org/rules/cleancode.html#elseexpression

                            The method _getUpdateMethod uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                            Open

                                        } else {
                                            $this->updateMethod = false;
                                        }
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            ElseExpression

                            Since: 1.4.0

                            An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                            Example

                            class Foo
                            {
                                public function bar($flag)
                                {
                                    if ($flag) {
                                        // one branch
                                    } else {
                                        // another branch
                                    }
                                }
                            }

                            Source https://phpmd.org/rules/cleancode.html#elseexpression

                            The method shouldCacheBeUpdated uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                            Open

                                    } else {
                                        $interval = 0;
                                    }
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            ElseExpression

                            Since: 1.4.0

                            An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                            Example

                            class Foo
                            {
                                public function bar($flag)
                                {
                                    if ($flag) {
                                        // one branch
                                    } else {
                                        // another branch
                                    }
                                }
                            }

                            Source https://phpmd.org/rules/cleancode.html#elseexpression

                            The method getBrowser uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                            Open

                                        } else {
                                            $user_agent = '';
                                        }
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            ElseExpression

                            Since: 1.4.0

                            An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                            Example

                            class Foo
                            {
                                public function bar($flag)
                                {
                                    if ($flag) {
                                        // one branch
                                    } else {
                                        // another branch
                                    }
                                }
                            }

                            Source https://phpmd.org/rules/cleancode.html#elseexpression

                            The method getBrowser uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                            Open

                                            } else {
                                                $patternData = unserialize($patternData);
                            
                                                // match with numeric replacements
                                                array_shift($matches);
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            ElseExpression

                            Since: 1.4.0

                            An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                            Example

                            class Foo
                            {
                                public function bar($flag)
                                {
                                    if ($flag) {
                                        // one branch
                                    } else {
                                        // another branch
                                    }
                                }
                            }

                            Source https://phpmd.org/rules/cleancode.html#elseexpression

                            The method createCacheOldWay uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                            Open

                                    } else {
                                        $this->_source_version = $browsers[self::BROWSCAP_VERSION_KEY]['Version'];
                                    }
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            ElseExpression

                            Since: 1.4.0

                            An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                            Example

                            class Foo
                            {
                                public function bar($flag)
                                {
                                    if ($flag) {
                                        // one branch
                                    } else {
                                        // another branch
                                    }
                                }
                            }

                            Source https://phpmd.org/rules/cleancode.html#elseexpression

                            The method _getRemoteData uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                            Open

                                                } else {
                                                    $context = $this->_getStreamContext();
                            
                                                    $remote_handler = stream_socket_client(
                                                        $url,
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            ElseExpression

                            Since: 1.4.0

                            An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                            Example

                            class Foo
                            {
                                public function bar($flag)
                                {
                                    if ($flag) {
                                        // one branch
                                    } else {
                                        // another branch
                                    }
                                }
                            }

                            Source https://phpmd.org/rules/cleancode.html#elseexpression

                            The method __construct uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                            Open

                                    } else {
                                        $this->cacheDir = $cache_dir;
                                    }
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            ElseExpression

                            Since: 1.4.0

                            An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                            Example

                            class Foo
                            {
                                public function bar($flag)
                                {
                                    if ($flag) {
                                        // one branch
                                    } else {
                                        // another branch
                                    }
                                }
                            }

                            Source https://phpmd.org/rules/cleancode.html#elseexpression

                            Avoid assigning values to variables in if clauses and the like (line '584', column '24').
                            Open

                                public function updateCache()
                                {
                                    $lockfile = $this->cacheDir . 'cache.lock';
                            
                                    $lockRes = fopen($lockfile, 'w+');
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            IfStatementAssignment

                            Since: 2.7.0

                            Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

                            Example

                            class Foo
                            {
                                public function bar($flag)
                                {
                                    if ($foo = 'bar') { // possible typo
                                        // ...
                                    }
                                    if ($baz = 0) { // always false
                                        // ...
                                    }
                                }
                            }

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

                            The method deduplicatePattern uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                            Open

                                        } else {
                                            unset($patternData['first']);
                            
                                            $data = $this->deduplicateCompressionPattern($patternData, $pattern);
                                        }
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            ElseExpression

                            Since: 1.4.0

                            An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                            Example

                            class Foo
                            {
                                public function bar($flag)
                                {
                                    if ($flag) {
                                        // one branch
                                    } else {
                                        // another branch
                                    }
                                }
                            }

                            Source https://phpmd.org/rules/cleancode.html#elseexpression

                            The method _array2string uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                            Open

                                        } else {
                                            $value = "'" . str_replace("'", "\'", $value) . "'";
                                        }
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            ElseExpression

                            Since: 1.4.0

                            An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                            Example

                            class Foo
                            {
                                public function bar($flag)
                                {
                                    if ($flag) {
                                        // one branch
                                    } else {
                                        // another branch
                                    }
                                }
                            }

                            Source https://phpmd.org/rules/cleancode.html#elseexpression

                            The method _array2string uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                            Open

                                        } else {
                                            $key = "'" . str_replace("'", "\'", $key) . "' => ";
                                        }
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            ElseExpression

                            Since: 1.4.0

                            An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                            Example

                            class Foo
                            {
                                public function bar($flag)
                                {
                                    if ($flag) {
                                        // one branch
                                    } else {
                                        // another branch
                                    }
                                }
                            }

                            Source https://phpmd.org/rules/cleancode.html#elseexpression

                            The method createCacheNewWay uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                            Open

                                        } else {
                                            $positionIndex[$pattern] = 1;
                                        }
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            ElseExpression

                            Since: 1.4.0

                            An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                            Example

                            class Foo
                            {
                                public function bar($flag)
                                {
                                    if ($flag) {
                                        // one branch
                                    } else {
                                        // another branch
                                    }
                                }
                            }

                            Source https://phpmd.org/rules/cleancode.html#elseexpression

                            The method _getRemoteIniFile uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                            Open

                                        } else {
                                            throw new Exception('Could not write to "' . $path
                                                                . '" (check the permissions of the cache directory).');
                                        }
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            ElseExpression

                            Since: 1.4.0

                            An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                            Example

                            class Foo
                            {
                                public function bar($flag)
                                {
                                    if ($flag) {
                                        // one branch
                                    } else {
                                        // another branch
                                    }
                                }
                            }

                            Source https://phpmd.org/rules/cleancode.html#elseexpression

                            The method createCacheOldWay uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                            Open

                                            } else {
                                                $compressedPattern = preg_replace(
                                                    self::REGEX_DELIMITER . '\d' . self::REGEX_DELIMITER,
                                                    '(\d)',
                                                                                  $pattern
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            ElseExpression

                            Since: 1.4.0

                            An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                            Example

                            class Foo
                            {
                                public function bar($flag)
                                {
                                    if ($flag) {
                                        // one branch
                                    } else {
                                        // another branch
                                    }
                                }
                            }

                            Source https://phpmd.org/rules/cleancode.html#elseexpression

                            The method createCacheNewWay uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                            Open

                                            } else {
                                                $compressedPattern = preg_replace(
                                                    self::REGEX_DELIMITER . '\d' . self::REGEX_DELIMITER,
                                                    '(\d)',
                                                                                  $pattern
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            ElseExpression

                            Since: 1.4.0

                            An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                            Example

                            class Foo
                            {
                                public function bar($flag)
                                {
                                    if ($flag) {
                                        // one branch
                                    } else {
                                        // another branch
                                    }
                                }
                            }

                            Source https://phpmd.org/rules/cleancode.html#elseexpression

                            Identical blocks of code found in 2 locations. Consider refactoring.
                            Open

                                            if (!$countMatches) {
                                                $tmpPatterns[$pattern] = $i;
                                            } else {
                                                $compressedPattern = preg_replace(
                                                    self::REGEX_DELIMITER . '\d' . self::REGEX_DELIMITER,
                            Severity: Major
                            Found in class/phpbrowscap/Browscap.php and 1 other location - About 1 hr to fix
                            class/phpbrowscap/Browscap.php on lines 769..783

                            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 104.

                            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

                            Identical blocks of code found in 2 locations. Consider refactoring.
                            Open

                                            if (!$countMatches) {
                                                $tmpPatterns[$pattern] = $i;
                                            } else {
                                                $compressedPattern = preg_replace(
                                                    self::REGEX_DELIMITER . '\d' . self::REGEX_DELIMITER,
                            Severity: Major
                            Found in class/phpbrowscap/Browscap.php and 1 other location - About 1 hr to fix
                            class/phpbrowscap/Browscap.php on lines 660..674

                            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 104.

                            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

                            Avoid excessively long variable names like $_streamContextOptions. Keep variable name length under 20.
                            Open

                                protected $_streamContextOptions = [];
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            LongVariable

                            Since: 0.2

                            Detects when a field, formal or local variable is declared with a long name.

                            Example

                            class Something {
                                protected $reallyLongIntName = -3; // VIOLATION - Field
                                public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
                                    $otherReallyLongName = -5; // VIOLATION - Local
                                    for ($interestingIntIndex = 0; // VIOLATION - For
                                         $interestingIntIndex < 10;
                                         $interestingIntIndex++ ) {
                                    }
                                }
                            }

                            Source https://phpmd.org/rules/naming.html#longvariable

                            Avoid variables with short names like $ua. Configured minimum length is 3.
                            Open

                                    $ua = str_replace('%v', self::VERSION, $this->userAgent);
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            ShortVariable

                            Since: 0.2

                            Detects when a field, local, or parameter has a very short name.

                            Example

                            class Something {
                                private $q = 15; // VIOLATION - Field
                                public static function main( array $as ) { // VIOLATION - Formal
                                    $r = 20 + $this->q; // VIOLATION - Local
                                    for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                                        $r += $this->q;
                                    }
                                }
                            }

                            Source https://phpmd.org/rules/naming.html#shortvariable

                            Avoid variables with short names like $ch. Configured minimum length is 3.
                            Open

                                                $ch = curl_init($url);
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            ShortVariable

                            Since: 0.2

                            Detects when a field, local, or parameter has a very short name.

                            Example

                            class Something {
                                private $q = 15; // VIOLATION - Field
                                public static function main( array $as ) { // VIOLATION - Formal
                                    $r = 20 + $this->q; // VIOLATION - Local
                                    for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                                        $r += $this->q;
                                    }
                                }
                            }

                            Source https://phpmd.org/rules/naming.html#shortvariable

                            The parameter $cache_dir is not named in camelCase.
                            Open

                                public function __construct($cache_dir = null)
                                {
                                    // has to be set to reach E_STRICT compatibility, does not affect system/app settings
                                    date_default_timezone_set(date_default_timezone_get());
                            
                            
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseParameterName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name parameters.

                            Example

                            class ClassName {
                                public function doSomething($user_name) {
                                }
                            }

                            Source

                            The property $_properties is not named in camelCase.
                            Open

                            class Browscap
                            {
                                /**
                                 * Current version of the class.
                                 */
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCasePropertyName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name attributes.

                            Example

                            class ClassName {
                                protected $property_name;
                            }

                            Source

                            Avoid variables with short names like $b. Configured minimum length is 3.
                            Open

                                protected function compareBcStrings($a, $b)
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            ShortVariable

                            Since: 0.2

                            Detects when a field, local, or parameter has a very short name.

                            Example

                            class Something {
                                private $q = 15; // VIOLATION - Field
                                public static function main( array $as ) { // VIOLATION - Formal
                                    $r = 20 + $this->q; // VIOLATION - Local
                                    for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                                        $r += $this->q;
                                    }
                                }
                            }

                            Source https://phpmd.org/rules/naming.html#shortvariable

                            The property $_browsers is not named in camelCase.
                            Open

                            class Browscap
                            {
                                /**
                                 * Current version of the class.
                                 */
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCasePropertyName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name attributes.

                            Example

                            class ClassName {
                                protected $property_name;
                            }

                            Source

                            The property $_cacheLoaded is not named in camelCase.
                            Open

                            class Browscap
                            {
                                /**
                                 * Current version of the class.
                                 */
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCasePropertyName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name attributes.

                            Example

                            class ClassName {
                                protected $property_name;
                            }

                            Source

                            The property $_userAgents is not named in camelCase.
                            Open

                            class Browscap
                            {
                                /**
                                 * Current version of the class.
                                 */
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCasePropertyName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name attributes.

                            Example

                            class ClassName {
                                protected $property_name;
                            }

                            Source

                            The parameter $return_array is not named in camelCase.
                            Open

                                public function getBrowser($user_agent = null, $return_array = false)
                                {
                                    if ($this->shouldCacheBeUpdated()) {
                                        try {
                                            $this->updateCache();
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseParameterName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name parameters.

                            Example

                            class ClassName {
                                public function doSomething($user_name) {
                                }
                            }

                            Source

                            The property $_patterns is not named in camelCase.
                            Open

                            class Browscap
                            {
                                /**
                                 * Current version of the class.
                                 */
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCasePropertyName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name attributes.

                            Example

                            class ClassName {
                                protected $property_name;
                            }

                            Source

                            The parameter $user_agent is not named in camelCase.
                            Open

                                public function getBrowser($user_agent = null, $return_array = false)
                                {
                                    if ($this->shouldCacheBeUpdated()) {
                                        try {
                                            $this->updateCache();
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseParameterName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name parameters.

                            Example

                            class ClassName {
                                public function doSomething($user_name) {
                                }
                            }

                            Source

                            Avoid variables with short names like $i. Configured minimum length is 3.
                            Open

                                            $i            = $position - 1;
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            ShortVariable

                            Since: 0.2

                            Detects when a field, local, or parameter has a very short name.

                            Example

                            class Something {
                                private $q = 15; // VIOLATION - Field
                                public static function main( array $as ) { // VIOLATION - Formal
                                    $r = 20 + $this->q; // VIOLATION - Local
                                    for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                                        $r += $this->q;
                                    }
                                }
                            }

                            Source https://phpmd.org/rules/naming.html#shortvariable

                            The property $_streamContext is not named in camelCase.
                            Open

                            class Browscap
                            {
                                /**
                                 * Current version of the class.
                                 */
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCasePropertyName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name attributes.

                            Example

                            class ClassName {
                                protected $property_name;
                            }

                            Source

                            The parameter $user_agent is not named in camelCase.
                            Open

                                protected function _pregQuote($user_agent)
                                {
                                    $pattern = preg_quote($user_agent, self::REGEX_DELIMITER);
                            
                                    // the \\x replacement is a fix for "Der gro\xdfe BilderSauger 2.00u" user agent match
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseParameterName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name parameters.

                            Example

                            class ClassName {
                                public function doSomething($user_name) {
                                }
                            }

                            Source

                            The parameter $cache_file is not named in camelCase.
                            Open

                                protected function _loadCache($cache_file)
                                {
                                    $cache_version  = null;
                                    $source_version = null;
                                    $browsers       = [];
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseParameterName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name parameters.

                            Example

                            class ClassName {
                                public function doSomething($user_name) {
                                }
                            }

                            Source

                            The property $_source_version is not named in camelCase.
                            Open

                            class Browscap
                            {
                                /**
                                 * Current version of the class.
                                 */
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCasePropertyName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name attributes.

                            Example

                            class ClassName {
                                protected $property_name;
                            }

                            Source

                            The property $_streamContextOptions is not named in camelCase.
                            Open

                            class Browscap
                            {
                                /**
                                 * Current version of the class.
                                 */
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCasePropertyName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name attributes.

                            Example

                            class ClassName {
                                protected $property_name;
                            }

                            Source

                            Avoid variables with short names like $a. Configured minimum length is 3.
                            Open

                                protected function compareBcStrings($a, $b)
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            ShortVariable

                            Since: 0.2

                            Detects when a field, local, or parameter has a very short name.

                            Example

                            class Something {
                                private $q = 15; // VIOLATION - Field
                                public static function main( array $as ) { // VIOLATION - Formal
                                    $r = 20 + $this->q; // VIOLATION - Local
                                    for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                                        $r += $this->q;
                                    }
                                }
                            }

                            Source https://phpmd.org/rules/naming.html#shortvariable

                            Each class must be in a file by itself
                            Open

                            class Exception extends \Exception

                            Blank line found at start of control structure
                            Open

                                    foreach ($wrappers as $wrapper) {

                            Property name "$_cacheLoaded" should not be prefixed with an underscore to indicate visibility
                            Open

                                protected $_cacheLoaded = false;

                            Method name "_pregQuote" should not be prefixed with an underscore to indicate visibility
                            Open

                                protected function _pregQuote($user_agent)

                            Property name "$_source_version" should not be prefixed with an underscore to indicate visibility
                            Open

                                protected $_source_version;

                            Method name "_getLocalMTime" should not be prefixed with an underscore to indicate visibility
                            Open

                                protected function _getLocalMTime()

                            Method name "_getUpdateMethod" should not be prefixed with an underscore to indicate visibility
                            Open

                                protected function _getUpdateMethod()

                            Property name "$_userAgents" should not be prefixed with an underscore to indicate visibility
                            Open

                                protected $_userAgents = [];

                            Property name "$_browsers" should not be prefixed with an underscore to indicate visibility
                            Open

                                protected $_browsers   = [];

                            Property name "$_properties" should not be prefixed with an underscore to indicate visibility
                            Open

                                protected $_properties = [];

                            Method name "_buildCache" should not be prefixed with an underscore to indicate visibility
                            Open

                                protected function _buildCache()

                            Property name "$_streamContextOptions" should not be prefixed with an underscore to indicate visibility
                            Open

                                protected $_streamContextOptions = [];

                            Method name "_getRemoteIniFile" should not be prefixed with an underscore to indicate visibility
                            Open

                                protected function _getRemoteIniFile($url, $path)

                            Method name "_array2string" should not be prefixed with an underscore to indicate visibility
                            Open

                                protected function _array2string($array)

                            Method name "_getRemoteMTime" should not be prefixed with an underscore to indicate visibility
                            Open

                                protected function _getRemoteMTime()

                            Property name "$_streamContext" should not be prefixed with an underscore to indicate visibility
                            Open

                                protected $_streamContext = null;

                            Method name "_getStreamContext" should not be prefixed with an underscore to indicate visibility
                            Open

                                protected function _getStreamContext($recreate = false)

                            Method name "_loadCache" should not be prefixed with an underscore to indicate visibility
                            Open

                                protected function _loadCache($cache_file)

                            Method name "_getUserAgent" should not be prefixed with an underscore to indicate visibility
                            Open

                                protected function _getUserAgent()

                            Method name "_pregUnQuote" should not be prefixed with an underscore to indicate visibility
                            Open

                                protected function _pregUnQuote($pattern, $matches)

                            Property name "$_patterns" should not be prefixed with an underscore to indicate visibility
                            Open

                                protected $_patterns   = [];

                            Method name "_getRemoteData" should not be prefixed with an underscore to indicate visibility
                            Open

                                protected function _getRemoteData($url)

                            The '_getRemoteIniFile()' method which returns a boolean should be named 'is...()' or 'has...()'
                            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 class/phpbrowscap/Browscap.php by phpmd

                            BooleanGetMethodName

                            Since: 0.2

                            Looks for methods named 'getX()' with 'boolean' as the return type. The convention is to name these methods 'isX()' or 'hasX()'.

                            Example

                            class Foo {
                                /**
                                 * @return boolean
                                 */
                                public function getFoo() {} // bad
                                /**
                                 * @return bool
                                 */
                                public function isFoo(); // ok
                                /**
                                 * @return boolean
                                 */
                                public function getFoo($bar); // ok, unless checkParameterizedMethods=true
                            }

                            Source https://phpmd.org/rules/naming.html#booleangetmethodname

                            Line exceeds 120 characters; contains 122 characters
                            Open

                                            throw new Exception('Your server can\'t connect to external resources. Please update the file manually.');

                            Multi-line function call not indented correctly; expected 12 spaces but found 24
                            Open

                                                    SORT_DESC,

                            Multi-line function call not indented correctly; expected 16 spaces but found 40
                            Open

                                                                    $old_cache_dir

                            Multi-line function call not indented correctly; expected 24 spaces but found 54
                            Open

                                                                                  $pattern

                            Multi-line function call not indented correctly; expected 20 spaces but found 47
                            Open

                                                                           $matches

                            Multi-line function call not indented correctly; expected 24 spaces but found 54
                            Open

                                                                                  $pattern

                            Multi-line function call not indented correctly; expected 12 spaces but found 27
                            Open

                                                       "'" . self::CACHE_FILE_VERSION . "'"

                            Multi-line function call not indented correctly; expected 28 spaces but found 63
                            Open

                                                                                           STREAM_CLIENT_CONNECT,

                            Multi-line function call not indented correctly; expected 24 spaces but found 77
                            Open

                                                                                                         $matches

                            Multi-line function call not indented correctly; expected 16 spaces but found 61
                            Open

                                                                                         array_diff_assoc($some_match, $identical)

                            Multi-line function call not indented correctly; expected 20 spaces but found 47
                            Open

                                                                           $matches

                            Multi-line function call not indented correctly; expected 28 spaces but found 39
                            Open

                                                                   $this->_getUserAgent()

                            The variable $cache_dir is not named in camelCase.
                            Open

                                public function __construct($cache_dir = null)
                                {
                                    // has to be set to reach E_STRICT compatibility, does not affect system/app settings
                                    date_default_timezone_set(date_default_timezone_get());
                            
                            
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $ini_file is not named in camelCase.
                            Open

                                public function shouldCacheBeUpdated()
                                {
                                    // Load the cache at the first request
                                    if ($this->_cacheLoaded) {
                                        return false;
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $ini_file is not named in camelCase.
                            Open

                                public function getBrowser($user_agent = null, $return_array = false)
                                {
                                    if ($this->shouldCacheBeUpdated()) {
                                        try {
                                            $this->updateCache();
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $cache_file is not named in camelCase.
                            Open

                                public function getBrowser($user_agent = null, $return_array = false)
                                {
                                    if ($this->shouldCacheBeUpdated()) {
                                        try {
                                            $this->updateCache();
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $tmp_matches is not named in camelCase.
                            Open

                                protected function deduplicateCompressionPattern($matches, &$pattern)
                                {
                                    $tmp_matches = $matches;
                                    $first_match = array_shift($tmp_matches);
                                    $differences = [];
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $some_match is not named in camelCase.
                            Open

                                protected function deduplicateCompressionPattern($matches, &$pattern)
                                {
                                    $tmp_matches = $matches;
                                    $first_match = array_shift($tmp_matches);
                                    $differences = [];
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $cache_version is not named in camelCase.
                            Open

                                protected function _loadCache($cache_file)
                                {
                                    $cache_version  = null;
                                    $source_version = null;
                                    $browsers       = [];
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $remote_handler is not named in camelCase.
                            Open

                                protected function _getRemoteData($url)
                                {
                                    ini_set('user_agent', $this->_getUserAgent());
                            
                                    switch ($this->_getUpdateMethod()) {
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $cache_dir is not named in camelCase.
                            Open

                                public function __construct($cache_dir = null)
                                {
                                    // has to be set to reach E_STRICT compatibility, does not affect system/app settings
                                    date_default_timezone_set(date_default_timezone_get());
                            
                            
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $cache_dir is not named in camelCase.
                            Open

                                public function __construct($cache_dir = null)
                                {
                                    // has to be set to reach E_STRICT compatibility, does not affect system/app settings
                                    date_default_timezone_set(date_default_timezone_get());
                            
                            
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $ini_path is not named in camelCase.
                            Open

                                public function updateCache()
                                {
                                    $lockfile = $this->cacheDir . 'cache.lock';
                            
                                    $lockRes = fopen($lockfile, 'w+');
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $cache_path is not named in camelCase.
                            Open

                                public function updateCache()
                                {
                                    $lockfile = $this->cacheDir . 'cache.lock';
                            
                                    $lockRes = fopen($lockfile, 'w+');
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $b_len is not named in camelCase.
                            Open

                                protected function compareBcStrings($a, $b)
                                {
                                    $a_len = strlen($a);
                                    $b_len = strlen($b);
                            
                            
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $b_len is not named in camelCase.
                            Open

                                protected function compareBcStrings($a, $b)
                                {
                                    $a_len = strlen($a);
                                    $b_len = strlen($b);
                            
                            
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $remote_tmstp is not named in camelCase.
                            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 class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $remote_tmstp is not named in camelCase.
                            Open

                                protected function _getRemoteMTime()
                                {
                                    $remote_datetime = $this->_getRemoteData($this->remoteVerUrl);
                                    $remote_tmstp    = strtotime($remote_datetime);
                            
                            
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $remote_handler is not named in camelCase.
                            Open

                                protected function _getRemoteData($url)
                                {
                                    ini_set('user_agent', $this->_getUserAgent());
                            
                                    switch ($this->_getUpdateMethod()) {
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $old_cache_dir is not named in camelCase.
                            Open

                                public function __construct($cache_dir = null)
                                {
                                    // has to be set to reach E_STRICT compatibility, does not affect system/app settings
                                    date_default_timezone_set(date_default_timezone_get());
                            
                            
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $ini_path is not named in camelCase.
                            Open

                                public function updateCache()
                                {
                                    $lockfile = $this->cacheDir . 'cache.lock';
                            
                                    $lockRes = fopen($lockfile, 'w+');
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $cache_path is not named in camelCase.
                            Open

                                public function updateCache()
                                {
                                    $lockfile = $this->cacheDir . 'cache.lock';
                            
                                    $lockRes = fopen($lockfile, 'w+');
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $pattern_parts is not named in camelCase.
                            Open

                                protected function deduplicateCompressionPattern($matches, &$pattern)
                                {
                                    $tmp_matches = $matches;
                                    $first_match = array_shift($tmp_matches);
                                    $differences = [];
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $remote_datetime is not named in camelCase.
                            Open

                                protected function _getRemoteMTime()
                                {
                                    $remote_datetime = $this->_getRemoteData($this->remoteVerUrl);
                                    $remote_tmstp    = strtotime($remote_datetime);
                            
                            
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $cache_dir is not named in camelCase.
                            Open

                                public function __construct($cache_dir = null)
                                {
                                    // has to be set to reach E_STRICT compatibility, does not affect system/app settings
                                    date_default_timezone_set(date_default_timezone_get());
                            
                            
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $user_agent is not named in camelCase.
                            Open

                                public function getBrowser($user_agent = null, $return_array = false)
                                {
                                    if ($this->shouldCacheBeUpdated()) {
                                        try {
                                            $this->updateCache();
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $tmp_matches is not named in camelCase.
                            Open

                                protected function deduplicateCompressionPattern($matches, &$pattern)
                                {
                                    $tmp_matches = $matches;
                                    $first_match = array_shift($tmp_matches);
                                    $differences = [];
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $first_match is not named in camelCase.
                            Open

                                protected function deduplicateCompressionPattern($matches, &$pattern)
                                {
                                    $tmp_matches = $matches;
                                    $first_match = array_shift($tmp_matches);
                                    $differences = [];
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $prepared_matches is not named in camelCase.
                            Open

                                protected function deduplicateCompressionPattern($matches, &$pattern)
                                {
                                    $tmp_matches = $matches;
                                    $first_match = array_shift($tmp_matches);
                                    $differences = [];
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $remote_url is not named in camelCase.
                            Open

                                protected function _getRemoteData($url)
                                {
                                    ini_set('user_agent', $this->_getUserAgent());
                            
                                    switch ($this->_getUpdateMethod()) {
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $remote_handler is not named in camelCase.
                            Open

                                protected function _getRemoteData($url)
                                {
                                    ini_set('user_agent', $this->_getUserAgent());
                            
                                    switch ($this->_getUpdateMethod()) {
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $cache_dir is not named in camelCase.
                            Open

                                public function __construct($cache_dir = null)
                                {
                                    // has to be set to reach E_STRICT compatibility, does not affect system/app settings
                                    date_default_timezone_set(date_default_timezone_get());
                            
                            
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $ini_file is not named in camelCase.
                            Open

                                public function getBrowser($user_agent = null, $return_array = false)
                                {
                                    if ($this->shouldCacheBeUpdated()) {
                                        try {
                                            $this->updateCache();
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $a_len is not named in camelCase.
                            Open

                                protected function compareBcStrings($a, $b)
                                {
                                    $a_len = strlen($a);
                                    $b_len = strlen($b);
                            
                            
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $a_len is not named in camelCase.
                            Open

                                protected function compareBcStrings($a, $b)
                                {
                                    $a_len = strlen($a);
                                    $b_len = strlen($b);
                            
                            
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $prepared_matches is not named in camelCase.
                            Open

                                protected function deduplicateCompressionPattern($matches, &$pattern)
                                {
                                    $tmp_matches = $matches;
                                    $first_match = array_shift($tmp_matches);
                                    $differences = [];
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $remote_tmstp is not named in camelCase.
                            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 class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $old_cache_dir is not named in camelCase.
                            Open

                                public function __construct($cache_dir = null)
                                {
                                    // has to be set to reach E_STRICT compatibility, does not affect system/app settings
                                    date_default_timezone_set(date_default_timezone_get());
                            
                            
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $cache_path is not named in camelCase.
                            Open

                                public function updateCache()
                                {
                                    $lockfile = $this->cacheDir . 'cache.lock';
                            
                                    $lockRes = fopen($lockfile, 'w+');
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $b_len is not named in camelCase.
                            Open

                                protected function compareBcStrings($a, $b)
                                {
                                    $a_len = strlen($a);
                                    $b_len = strlen($b);
                            
                            
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $prepared_matches is not named in camelCase.
                            Open

                                protected function deduplicateCompressionPattern($matches, &$pattern)
                                {
                                    $tmp_matches = $matches;
                                    $first_match = array_shift($tmp_matches);
                                    $differences = [];
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $cache_version is not named in camelCase.
                            Open

                                protected function _loadCache($cache_file)
                                {
                                    $cache_version  = null;
                                    $source_version = null;
                                    $browsers       = [];
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $local_tmstp is not named in camelCase.
                            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 class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $remote_tmstp is not named in camelCase.
                            Open

                                protected function _getRemoteMTime()
                                {
                                    $remote_datetime = $this->_getRemoteData($this->remoteVerUrl);
                                    $remote_tmstp    = strtotime($remote_datetime);
                            
                            
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $first_match is not named in camelCase.
                            Open

                                protected function deduplicateCompressionPattern($matches, &$pattern)
                                {
                                    $tmp_matches = $matches;
                                    $first_match = array_shift($tmp_matches);
                                    $differences = [];
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $source_version is not named in camelCase.
                            Open

                                protected function _loadCache($cache_file)
                                {
                                    $cache_version  = null;
                                    $source_version = null;
                                    $browsers       = [];
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $remote_url is not named in camelCase.
                            Open

                                protected function _getRemoteData($url)
                                {
                                    ini_set('user_agent', $this->_getUserAgent());
                            
                                    switch ($this->_getUpdateMethod()) {
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $cache_dir is not named in camelCase.
                            Open

                                public function __construct($cache_dir = null)
                                {
                                    // has to be set to reach E_STRICT compatibility, does not affect system/app settings
                                    date_default_timezone_set(date_default_timezone_get());
                            
                            
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $user_agent is not named in camelCase.
                            Open

                                public function getBrowser($user_agent = null, $return_array = false)
                                {
                                    if ($this->shouldCacheBeUpdated()) {
                                        try {
                                            $this->updateCache();
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $cache_path is not named in camelCase.
                            Open

                                public function updateCache()
                                {
                                    $lockfile = $this->cacheDir . 'cache.lock';
                            
                                    $lockRes = fopen($lockfile, 'w+');
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $a_len is not named in camelCase.
                            Open

                                protected function compareBcStrings($a, $b)
                                {
                                    $a_len = strlen($a);
                                    $b_len = strlen($b);
                            
                            
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $tmp_matches is not named in camelCase.
                            Open

                                protected function deduplicateCompressionPattern($matches, &$pattern)
                                {
                                    $tmp_matches = $matches;
                                    $first_match = array_shift($tmp_matches);
                                    $differences = [];
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $some_match is not named in camelCase.
                            Open

                                protected function deduplicateCompressionPattern($matches, &$pattern)
                                {
                                    $tmp_matches = $matches;
                                    $first_match = array_shift($tmp_matches);
                                    $differences = [];
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $pattern_parts is not named in camelCase.
                            Open

                                protected function deduplicateCompressionPattern($matches, &$pattern)
                                {
                                    $tmp_matches = $matches;
                                    $first_match = array_shift($tmp_matches);
                                    $differences = [];
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $cache_file is not named in camelCase.
                            Open

                                protected function _loadCache($cache_file)
                                {
                                    $cache_version  = null;
                                    $source_version = null;
                                    $browsers       = [];
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $remote_tmstp is not named in camelCase.
                            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 class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $cache_file is not named in camelCase.
                            Open

                                public function shouldCacheBeUpdated()
                                {
                                    // Load the cache at the first request
                                    if ($this->_cacheLoaded) {
                                        return false;
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $cache_file is not named in camelCase.
                            Open

                                public function getBrowser($user_agent = null, $return_array = false)
                                {
                                    if ($this->shouldCacheBeUpdated()) {
                                        try {
                                            $this->updateCache();
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $user_agent is not named in camelCase.
                            Open

                                public function getBrowser($user_agent = null, $return_array = false)
                                {
                                    if ($this->shouldCacheBeUpdated()) {
                                        try {
                                            $this->updateCache();
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $return_array is not named in camelCase.
                            Open

                                public function getBrowser($user_agent = null, $return_array = false)
                                {
                                    if ($this->shouldCacheBeUpdated()) {
                                        try {
                                            $this->updateCache();
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $some_match is not named in camelCase.
                            Open

                                protected function deduplicateCompressionPattern($matches, &$pattern)
                                {
                                    $tmp_matches = $matches;
                                    $first_match = array_shift($tmp_matches);
                                    $differences = [];
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $test_file is not named in camelCase.
                            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 class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $ini_file is not named in camelCase.
                            Open

                                public function shouldCacheBeUpdated()
                                {
                                    // Load the cache at the first request
                                    if ($this->_cacheLoaded) {
                                        return false;
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $ini_path is not named in camelCase.
                            Open

                                public function updateCache()
                                {
                                    $lockfile = $this->cacheDir . 'cache.lock';
                            
                                    $lockRes = fopen($lockfile, 'w+');
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $a_len is not named in camelCase.
                            Open

                                protected function compareBcStrings($a, $b)
                                {
                                    $a_len = strlen($a);
                                    $b_len = strlen($b);
                            
                            
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $some_match is not named in camelCase.
                            Open

                                protected function deduplicateCompressionPattern($matches, &$pattern)
                                {
                                    $tmp_matches = $matches;
                                    $first_match = array_shift($tmp_matches);
                                    $differences = [];
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $pattern_parts is not named in camelCase.
                            Open

                                protected function deduplicateCompressionPattern($matches, &$pattern)
                                {
                                    $tmp_matches = $matches;
                                    $first_match = array_shift($tmp_matches);
                                    $differences = [];
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $user_agent is not named in camelCase.
                            Open

                                protected function _pregQuote($user_agent)
                                {
                                    $pattern = preg_quote($user_agent, self::REGEX_DELIMITER);
                            
                                    // the \\x replacement is a fix for "Der gro\xdfe BilderSauger 2.00u" user agent match
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $source_version is not named in camelCase.
                            Open

                                protected function _loadCache($cache_file)
                                {
                                    $cache_version  = null;
                                    $source_version = null;
                                    $browsers       = [];
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $remote_handler is not named in camelCase.
                            Open

                                protected function _getRemoteData($url)
                                {
                                    ini_set('user_agent', $this->_getUserAgent());
                            
                                    switch ($this->_getUpdateMethod()) {
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $ini_file is not named in camelCase.
                            Open

                                public function getBrowser($user_agent = null, $return_array = false)
                                {
                                    if ($this->shouldCacheBeUpdated()) {
                                        try {
                                            $this->updateCache();
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $a_len is not named in camelCase.
                            Open

                                protected function compareBcStrings($a, $b)
                                {
                                    $a_len = strlen($a);
                                    $b_len = strlen($b);
                            
                            
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $test_file is not named in camelCase.
                            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 class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $test_file is not named in camelCase.
                            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 class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $remote_handler is not named in camelCase.
                            Open

                                protected function _getRemoteData($url)
                                {
                                    ini_set('user_agent', $this->_getUserAgent());
                            
                                    switch ($this->_getUpdateMethod()) {
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $remote_handler is not named in camelCase.
                            Open

                                protected function _getRemoteData($url)
                                {
                                    ini_set('user_agent', $this->_getUserAgent());
                            
                                    switch ($this->_getUpdateMethod()) {
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $remote_url is not named in camelCase.
                            Open

                                protected function _getRemoteData($url)
                                {
                                    ini_set('user_agent', $this->_getUserAgent());
                            
                                    switch ($this->_getUpdateMethod()) {
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $cache_dir is not named in camelCase.
                            Open

                                public function __construct($cache_dir = null)
                                {
                                    // has to be set to reach E_STRICT compatibility, does not affect system/app settings
                                    date_default_timezone_set(date_default_timezone_get());
                            
                            
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $cache_file is not named in camelCase.
                            Open

                                public function shouldCacheBeUpdated()
                                {
                                    // Load the cache at the first request
                                    if ($this->_cacheLoaded) {
                                        return false;
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $user_agent is not named in camelCase.
                            Open

                                public function getBrowser($user_agent = null, $return_array = false)
                                {
                                    if ($this->shouldCacheBeUpdated()) {
                                        try {
                                            $this->updateCache();
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $first_match is not named in camelCase.
                            Open

                                protected function deduplicateCompressionPattern($matches, &$pattern)
                                {
                                    $tmp_matches = $matches;
                                    $first_match = array_shift($tmp_matches);
                                    $differences = [];
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $pattern_parts is not named in camelCase.
                            Open

                                protected function deduplicateCompressionPattern($matches, &$pattern)
                                {
                                    $tmp_matches = $matches;
                                    $first_match = array_shift($tmp_matches);
                                    $differences = [];
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $pattern_parts is not named in camelCase.
                            Open

                                protected function deduplicateCompressionPattern($matches, &$pattern)
                                {
                                    $tmp_matches = $matches;
                                    $first_match = array_shift($tmp_matches);
                                    $differences = [];
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $remote_url is not named in camelCase.
                            Open

                                protected function _getRemoteData($url)
                                {
                                    ini_set('user_agent', $this->_getUserAgent());
                            
                                    switch ($this->_getUpdateMethod()) {
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $remote_url is not named in camelCase.
                            Open

                                protected function _getRemoteData($url)
                                {
                                    ini_set('user_agent', $this->_getUserAgent());
                            
                                    switch ($this->_getUpdateMethod()) {
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $remote_url is not named in camelCase.
                            Open

                                protected function _getRemoteData($url)
                                {
                                    ini_set('user_agent', $this->_getUserAgent());
                            
                                    switch ($this->_getUpdateMethod()) {
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $cache_dir is not named in camelCase.
                            Open

                                public function __construct($cache_dir = null)
                                {
                                    // has to be set to reach E_STRICT compatibility, does not affect system/app settings
                                    date_default_timezone_set(date_default_timezone_get());
                            
                            
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $cache_dir is not named in camelCase.
                            Open

                                public function __construct($cache_dir = null)
                                {
                                    // has to be set to reach E_STRICT compatibility, does not affect system/app settings
                                    date_default_timezone_set(date_default_timezone_get());
                            
                            
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $ini_file is not named in camelCase.
                            Open

                                public function shouldCacheBeUpdated()
                                {
                                    // Load the cache at the first request
                                    if ($this->_cacheLoaded) {
                                        return false;
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $cache_file is not named in camelCase.
                            Open

                                public function shouldCacheBeUpdated()
                                {
                                    // Load the cache at the first request
                                    if ($this->_cacheLoaded) {
                                        return false;
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $user_agent is not named in camelCase.
                            Open

                                public function getBrowser($user_agent = null, $return_array = false)
                                {
                                    if ($this->shouldCacheBeUpdated()) {
                                        try {
                                            $this->updateCache();
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $b_len is not named in camelCase.
                            Open

                                protected function compareBcStrings($a, $b)
                                {
                                    $a_len = strlen($a);
                                    $b_len = strlen($b);
                            
                            
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $pattern_parts is not named in camelCase.
                            Open

                                protected function deduplicateCompressionPattern($matches, &$pattern)
                                {
                                    $tmp_matches = $matches;
                                    $first_match = array_shift($tmp_matches);
                                    $differences = [];
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $remote_datetime is not named in camelCase.
                            Open

                                protected function _getRemoteMTime()
                                {
                                    $remote_datetime = $this->_getRemoteData($this->remoteVerUrl);
                                    $remote_tmstp    = strtotime($remote_datetime);
                            
                            
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $remote_handler is not named in camelCase.
                            Open

                                protected function _getRemoteData($url)
                                {
                                    ini_set('user_agent', $this->_getUserAgent());
                            
                                    switch ($this->_getUpdateMethod()) {
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $remote_handler is not named in camelCase.
                            Open

                                protected function _getRemoteData($url)
                                {
                                    ini_set('user_agent', $this->_getUserAgent());
                            
                                    switch ($this->_getUpdateMethod()) {
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $ini_file is not named in camelCase.
                            Open

                                public function shouldCacheBeUpdated()
                                {
                                    // Load the cache at the first request
                                    if ($this->_cacheLoaded) {
                                        return false;
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $user_agent is not named in camelCase.
                            Open

                                public function getBrowser($user_agent = null, $return_array = false)
                                {
                                    if ($this->shouldCacheBeUpdated()) {
                                        try {
                                            $this->updateCache();
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $b_len is not named in camelCase.
                            Open

                                protected function compareBcStrings($a, $b)
                                {
                                    $a_len = strlen($a);
                                    $b_len = strlen($b);
                            
                            
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $a_len is not named in camelCase.
                            Open

                                protected function compareBcStrings($a, $b)
                                {
                                    $a_len = strlen($a);
                                    $b_len = strlen($b);
                            
                            
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $b_len is not named in camelCase.
                            Open

                                protected function compareBcStrings($a, $b)
                                {
                                    $a_len = strlen($a);
                                    $b_len = strlen($b);
                            
                            
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $cache_version is not named in camelCase.
                            Open

                                protected function _loadCache($cache_file)
                                {
                                    $cache_version  = null;
                                    $source_version = null;
                                    $browsers       = [];
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $local_tmstp is not named in camelCase.
                            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 class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $remote_tmstp is not named in camelCase.
                            Open

                                protected function _getRemoteMTime()
                                {
                                    $remote_datetime = $this->_getRemoteData($this->remoteVerUrl);
                                    $remote_tmstp    = strtotime($remote_datetime);
                            
                            
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $remote_url is not named in camelCase.
                            Open

                                protected function _getRemoteData($url)
                                {
                                    ini_set('user_agent', $this->_getUserAgent());
                            
                                    switch ($this->_getUpdateMethod()) {
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $remote_url is not named in camelCase.
                            Open

                                protected function _getRemoteData($url)
                                {
                                    ini_set('user_agent', $this->_getUserAgent());
                            
                                    switch ($this->_getUpdateMethod()) {
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $remote_url is not named in camelCase.
                            Open

                                protected function _getRemoteData($url)
                                {
                                    ini_set('user_agent', $this->_getUserAgent());
                            
                                    switch ($this->_getUpdateMethod()) {
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $remote_handler is not named in camelCase.
                            Open

                                protected function _getRemoteData($url)
                                {
                                    ini_set('user_agent', $this->_getUserAgent());
                            
                                    switch ($this->_getUpdateMethod()) {
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The method _getRemoteData is not named in camelCase.
                            Open

                                protected function _getRemoteData($url)
                                {
                                    ini_set('user_agent', $this->_getUserAgent());
                            
                                    switch ($this->_getUpdateMethod()) {
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseMethodName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name methods.

                            Example

                            class ClassName {
                                public function get_name() {
                                }
                            }

                            Source

                            The method _getUserAgent is not named in camelCase.
                            Open

                                protected function _getUserAgent()
                                {
                                    $ua = str_replace('%v', self::VERSION, $this->userAgent);
                                    $ua = str_replace('%m', $this->_getUpdateMethod(), $ua);
                            
                            
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseMethodName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name methods.

                            Example

                            class ClassName {
                                public function get_name() {
                                }
                            }

                            Source

                            The method _getStreamContext is not named in camelCase.
                            Open

                                protected function _getStreamContext($recreate = false)
                                {
                                    if (!isset($this->_streamContext) || true === $recreate) {
                                        $this->_streamContext = stream_context_create($this->getStreamContextOptions());
                                    }
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseMethodName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name methods.

                            Example

                            class ClassName {
                                public function get_name() {
                                }
                            }

                            Source

                            The method _getLocalMTime is not named in camelCase.
                            Open

                                protected function _getLocalMTime()
                                {
                                    if (!is_readable($this->localFile) || !is_file($this->localFile)) {
                                        throw new Exception('Local file is not readable');
                                    }
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseMethodName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name methods.

                            Example

                            class ClassName {
                                public function get_name() {
                                }
                            }

                            Source

                            The method _getRemoteMTime is not named in camelCase.
                            Open

                                protected function _getRemoteMTime()
                                {
                                    $remote_datetime = $this->_getRemoteData($this->remoteVerUrl);
                                    $remote_tmstp    = strtotime($remote_datetime);
                            
                            
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseMethodName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name methods.

                            Example

                            class ClassName {
                                public function get_name() {
                                }
                            }

                            Source

                            The method _array2string is not named in camelCase.
                            Open

                                protected function _array2string($array)
                                {
                                    $content = "array(\n";
                            
                                    foreach ($array as $key => $value) {
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseMethodName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name methods.

                            Example

                            class ClassName {
                                public function get_name() {
                                }
                            }

                            Source

                            The method _buildCache is not named in camelCase.
                            Open

                                protected function _buildCache()
                                {
                                    $content = sprintf(
                                        "<?php\n\$source_version=%s;\n\$cache_version=%s",
                                        "'" . $this->_source_version . "'",
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseMethodName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name methods.

                            Example

                            class ClassName {
                                public function get_name() {
                                }
                            }

                            Source

                            The method _getRemoteIniFile is not named in camelCase.
                            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 class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseMethodName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name methods.

                            Example

                            class ClassName {
                                public function get_name() {
                                }
                            }

                            Source

                            The method _getUpdateMethod is not named in camelCase.
                            Open

                                protected function _getUpdateMethod()
                                {
                                    // Caches the result
                                    if (null === $this->updateMethod) {
                                        if (null !== $this->localFile) {
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseMethodName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name methods.

                            Example

                            class ClassName {
                                public function get_name() {
                                }
                            }

                            Source

                            The method _pregUnQuote is not named in camelCase.
                            Open

                                protected function _pregUnQuote($pattern, $matches)
                                {
                                    // list of escaped characters: http://www.php.net/manual/en/function.preg-quote.php
                                    // to properly unescape '?' which was changed to '.', I replace '\.' (real dot) with '\?',
                                    // then change '.' to '?' and then '\?' to '.'.
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseMethodName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name methods.

                            Example

                            class ClassName {
                                public function get_name() {
                                }
                            }

                            Source

                            The method _pregQuote is not named in camelCase.
                            Open

                                protected function _pregQuote($user_agent)
                                {
                                    $pattern = preg_quote($user_agent, self::REGEX_DELIMITER);
                            
                                    // the \\x replacement is a fix for "Der gro\xdfe BilderSauger 2.00u" user agent match
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseMethodName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name methods.

                            Example

                            class ClassName {
                                public function get_name() {
                                }
                            }

                            Source

                            The method _loadCache is not named in camelCase.
                            Open

                                protected function _loadCache($cache_file)
                                {
                                    $cache_version  = null;
                                    $source_version = null;
                                    $browsers       = [];
                            Severity: Minor
                            Found in class/phpbrowscap/Browscap.php by phpmd

                            CamelCaseMethodName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name methods.

                            Example

                            class ClassName {
                                public function get_name() {
                                }
                            }

                            Source

                            There are no issues that match your filters.

                            Category
                            Status