Showing 286 of 512 total issues
Function editComment
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function editComment(int $id, int $cid, Request $request, Validator $validator)
{
$page = int($request->input('page', 1));
/** @var Offer $offer */
- 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 pagination
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function pagination(string $url = '/topics'): ?HtmlString
{
if (! $this->count_posts) {
return null;
}
- 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 deleteDir
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function deleteDir(string $dir)
{
if (file_exists($dir)) {
if ($files = glob($dir . '/*')) {
foreach ($files as $file) {
- 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 resizeProcess
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function resizeProcess(?string $path, array $params = []): array
{
if (empty($params['alt'])) {
$params['alt'] = basename($path);
}
- 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 close
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function close(int $id, Request $request, Validator $validator): RedirectResponse
{
if (! $user = getUser()) {
abort(403, __('main.not_authorized'));
}
- 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 apikey
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function apikey(Request $request): RedirectResponse
{
if (! $user = getUser()) {
abort(403, __('main.not_authorized'));
}
- 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 arrayDiffKeyRecursive
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function arrayDiffKeyRecursive(array $array1, array $array2): array
{
$diff = array_diff_key($array1, $array2);
foreach ($array1 as $k => $v) {
- 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 create
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function create(Request $request, Validator $validator, Flood $flood)
{
$bid = int($request->input('bid'));
if (! $user = getUser()) {
- 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 sendNotify
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function sendNotify(string $text, string $url, string $title)
{
/*$parseText = preg_replace('|\[quote(.*?)\](.*?)\[/quote\]|s', '', $text);*/
preg_match_all('/(?<=^|\s|=)@([\w\-]+)/', $text, $matches);
- 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 statAdverts
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function statAdverts(): array
{
if (! setting('rekusershow')) {
return [];
}
- 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 editComment
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function editComment(int $id, int $cid, Request $request, Validator $validator): View|RedirectResponse
{
$page = int($request->input('page', 1));
/** @var Article $article */
- 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 getCounter
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function getCounter(int $online): void
{
$counter = $this->getResultCounter();
if (! $counter) {
- 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 parse
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function parse(string $source): string
{
$source = nl2br($source, false);
$source = str_replace('[cut]', '', $source);
- 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 getStatuses
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function getStatuses(int $seconds): array
{
return Cache::remember('status', $seconds, static function () {
$users = self::query()
->select('users.id', 'users.status', 'status.name', 'status.color')
- 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 index
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function index(Request $request)
{
if ($request->isMethod('post')) {
$client = new Client(['timeout' => 30.0]);
- 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 search
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function search(Request $request, Validator $validator)
{
$find = check($request->input('find'));
$articles = collect();
- 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
Avoid too many return
statements within this method. Open
return response()->json([
'success' => true,
'cancel' => $cancel,
'rating' => formatNum($post['rating'])->toHtml(),
]);
Avoid too many return
statements within this method. Open
return response()->json(['success' => false]);
Avoid too many return
statements within this method. Open
return view('users/users', compact('users', 'user', 'type', 'sort'));
Avoid too many return
statements within this method. Open
return $num . ' ' . $forms[2];