fucongcong/framework

View on GitHub

Showing 66 of 1,150 total issues

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

public static function getFileTypeByMimeType($mimeType)
{
if (strpos($mimeType, 'video') === 0) {
return 'video';
} elseif (strpos($mimeType, 'audio') === 0) {
Severity: Minor
Found in core/Group/Common/FileToolkit.php - About 25 mins to fix

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

public static function changes(array $before, array $after)
{
$changes = array('before' => array(), 'after' => array());
foreach ($after as $key => $value) {
if (!isset($before[$key])) {
Severity: Minor
Found in core/Group/Common/ArrayToolkit.php - About 25 mins to fix

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

public function match()
{
$requestUri = $this->route->getUri();
 
$routing = $this->getRouting();
Severity: Minor
Found in core/Group/Routing/Router.php - About 25 mins to fix

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

public function set($cacheName, $data, $cacheDir = false, $flag = false)
{
$cacheDir = $cacheDir == false ? self::$cacheDir : $cacheDir;
if (defined('__FILEROOT__')) {
$dir = __FILEROOT__;
Severity: Minor
Found in core/Group/Cache/LocalFileCacheService.php - About 25 mins to fix

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

public function onWorkerStart(swoole_server $serv, $workerId)
{
opcache_reset();
$loader = require __ROOT__.'/vendor/autoload.php';
$loader->setUseIncludePath(true);
Severity: Minor
Found in core/Group/Async/Server/Server.php - About 25 mins to fix

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

private function setWorkNum($jobs)
{
$workerNum = 0;
foreach ($jobs as $job) {
$taskWorkerNum = 0;
Severity: Minor
Found in core/Group/Queue/Bear.php - About 25 mins to fix
Severity
Category
Status
Source
Language