Showing 22 of 22 total issues
Method getDeviceCode
has 404 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getDeviceCode(): string | null
{
$value = trim($this->value, '"');
$code = mb_strtolower($value);
Method getClientCode
has 221 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getClientCode(): string | null
{
// see also vendor/whichbrowser/parser/data/id-android.php
// see also vendor/matomo/device-detector/regexes/client/hints/apps.yml
return match (mb_strtolower($this->value)) {
Method __construct
has 101 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function __construct(
DeviceParserInterface $deviceParser,
PlatformParserInterface $platformParser,
BrowserParserInterface $browserParser,
EngineParserInterface $engineParser,
Method getVersion
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function getVersion(
stdClass | string | null $version,
string $useragent,
LoggerInterface $logger,
): VersionInterface {
Method getDeviceCode
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getDeviceCode(): string | null
{
$matches = [];
if (
Method isMobile
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function isMobile(string $useragent): bool
{
if (preg_match('/wpdesktop|zunewp7|xblwp7|windows (phone|mobile|ce)|polaris/i', $useragent)) {
return true;
}
Method isDesktopDevice
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function isDesktopDevice(string $useragent): bool
{
if (
preg_match(
'/windows ?(phone|iot|mobile|ce)|iemobile|lumia|xblwp7|zunewp7|wpdesktop|mobile version|microsoft windows; ppc| wds |wpos:|netgem|xoom/i',
Method __construct
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
DeviceParserInterface $deviceParser,
PlatformParserInterface $platformParser,
BrowserParserInterface $browserParser,
EngineParserInterface $engineParser,
NormalizerFactory $normalizerFactory,
Avoid too many return
statements within this method. Open
Open
return 0 < preg_match(
'/freebsd|openbsd|netbsd|bsd four|os\/2|warp|sunos|hp-?ux|beos|haiku|irix|solaris|openvms|aix|esx|unix|w3m|google desktop|eeepc|dillo|konqueror|eudora|masking-agent|safersurf|integrity|davclnt|cybeye|google pp default|microsoft office|nsplayer|ms ?frontpage|revolt|akregator|installatron|lynx|camino|osf1|barca|the bat!|libvlc|openvas|gvfs/i',
$useragent,
);
Avoid too many return
statements within this method. Open
Open
return 8;
Avoid too many return
statements within this method. Open
Open
return true;
Avoid too many return
statements within this method. Open
Open
return $versionClass;
Avoid too many return
statements within this method. Open
Open
return 0 < preg_match(
'/mobile;|mobileok|-mobile|office mobile|tablet|(?<!a)phone|wireless|(?<!ninesky-)android|adr |iph(one|\d)|ip[ao]d|ipd\d|samsung(?!browser|-agent)|j2me|micromax|htc|karbonn|hisense|docomo|siemens(?! ?(a\/s|testmanager|lms|ag))|ktouch|portalmmm|rim tablet|jolla|iball|symbos|symbian|remixos|webos|velocitymicro|samsung-(gt|sph)|lenovo|lumia|surftab|padfone|xda_diamond_2|transformer tf|touchpad|toshiba_ac_and_az|hpwos|silk|wap-browser|sailfish|crowsnest|folio_and_a|steelcore|m2 note|spice qt-75|spark284|lemon b556|terra_101|dino762|wetab|dataaccessd|lenovotablet|qtcarbrowser|onebrowser|stitcher|rss_?radio|antennapod|antenna\/|podcruncher|captivenetworksupport|(?<!c)ios;|audioboom.com\/boos|beyondpod|st80208|\[fban|wap2|up\.link|up\.browser|series ?[46]0|pocket ?pc|playstation|palm(?!a)|opera mobi|opera mini|openwave|obigo|nokia|nintendo|netfront|mqqbrowser|midp|meego|maemo|look-alike|like mac os x|kindle|juc ?\(linux; ?u;|iuc\(u;ios|iris|hp-tablet|hd_mini_t|gingerbread|folio100|foma|firefox or ie|embider|danger hiptop|cldc|blazer|dalvik|bolt|blackberry|bb10; ?(kbd|touch)|\b(bada|brew|mtk)\b|\btcl\b(?! http client)|aspen simulator|arm; touch|wap browser|kyy21|ebrd1101|ebrd1201|huawei-u8651|(?<!i)tizen|tecno[ _]|sonyericsson|lg[ \-]|(?<!ma)cos ?\d|cricket|mz601|clt-l29|ios\.watch|nook browser/i',
$useragent,
);
Avoid too many return
statements within this method. Open
Open
return $versionDetector->detectVersion($useragent, $searches);
Avoid too many return
statements within this method. Open
Open
return false;
Avoid too many return
statements within this method. Open
Open
return false;
Avoid too many return
statements within this method. Open
Open
return $versionClass;
Avoid too many return
statements within this method. Open
Open
return $versionClass;
Avoid too many return
statements within this method. Open
Open
return $versionDetector->detectVersion($useragent);
Avoid too many return
statements within this method. Open
Open
return null;