Showing 65 of 86 total issues
File Browscap.php
has 811 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace phpbrowscap;
/**
File ua-parser.js
has 665 lines of code (exceeds 250 allowed). Consider refactoring. Open
/////////////////////////////////////////////////////////////////////////////////
/* UAParser.js v1.0.32
Copyright © 2012-2021 Faisal Salman <f@faisalman.com>
MIT License *//*
Detect Browser, Engine, OS, CPU, and Device type/model from User-Agent data.
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();
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method createCacheNewWay
has 107 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function createCacheNewWay($iniContent)
{
$patternPositions = array();
// get all patterns from the ini file in the correct order,
Function createCacheNewWay
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
protected function createCacheNewWay($iniContent)
{
$patternPositions = array();
// get all patterns from the ini file in the correct order,
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
File counter.php
has 328 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*
* counter.php
* __ HZKnight free PHP Scripts _ vs 5.1
* / _| __ _ _ __ /\ /\___ _ _ _ __ | |_ ___ _ __
Function __construct
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
public function __construct($__url){
settype($__url,"string");
global $inf__engine,$inf__keyban;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function _getRemoteData
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
protected function _getRemoteData($url)
{
ini_set('user_agent', $this->_getUserAgent());
switch ($this->_getUpdateMethod()) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method getBrowser
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getBrowser($user_agent = null, $return_array = false)
{
if ($this->shouldCacheBeUpdated()) {
try {
$this->updateCache();
Browscap
has 28 functions (exceeds 20 allowed). Consider refactoring. Open
class Browscap
{
/**
* Current version of the class.
*/
Method _getRemoteData
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _getRemoteData($url)
{
ini_set('user_agent', $this->_getUserAgent());
switch ($this->_getUpdateMethod()) {
Method _panel1_
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _panel1_(){
global $cnf__last_entries;
global $dat__entry;
global $inf__country;
Function URL
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function URL($__url){
settype($__url,"string");
$__url_v=array("prot"=>"","host"=>"","port"=>"","path"=>"","page"=>"","para"=>"");
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function _getRemoteIniFile
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
protected function _getRemoteIniFile($url, $path)
{
// local and remote file are the same, no update possible
if ($url == $path) {
return false;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function UAParser
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
var UAParser = function (ua, extensions) {
if (typeof ua === OBJ_TYPE) {
extensions = ua;
ua = undefined;
Method URL
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function URL($__url){
settype($__url,"string");
$__url_v=array("prot"=>"","host"=>"","port"=>"","path"=>"","page"=>"","para"=>"");
Method createCacheOldWay
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function createCacheOldWay($iniContent, $actLikeNewVersion = false)
{
$browsers = parse_ini_string($iniContent, true, INI_SCANNER_RAW);
if ($actLikeNewVersion) {
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) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function _graph_
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
function _graph_($__data,$__type,$__title,$__header1,$__header2,$__header3,$__colsize1,$__colsize2,$__colsize3,$__unknownitem,$__strcut,$__restrict){
settype($__data,"array");
settype($__type,"string");
settype($__title,"string");
settype($__header1,"string");
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function func_replace
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
function func_replace( $html, $tag_left_delimiter, $tag_right_delimiter, $php_left_delimiter = null, $php_right_delimiter = null, $loop_level = null, $echo = null ){
preg_match_all( '/' . '\{\#{0,1}(\"{0,1}.*?\"{0,1})(\|\w.*?)\#{0,1}\}' . '/', $html, $matches );
for( $i=0, $n=count($matches[0]); $i<$n; $i++ ){
- Read upRead up
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"