Showing 11 of 36 total issues
DbUserRepository
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class DbUserRepository extends DbRepository implements UserRepository
{
/**
* DbUserRepository constructor.
*
File show.blade.php
has 253 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
@extends('ahk.layouts.master')
@section('title', "{$company->name} - {$industry->name}")
@section('inline-css')
<style type="text/css">
{!! File::get(public_path(elixir("css/industries/companies/show/above-the-fold-content.min.css"))) !!}
Method transform
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function transform($item)
{
return [
'name' => $item->name,
'slug' => $item->slug,
Method run
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function run()
{
Service::create(['name' => 'Knowledge Exchange', 'color' => Service::$colors[array_rand(Service::$colors)]]);
Service::create(['name' => 'Corporations', 'color' => Service::$colors[array_rand(Service::$colors)]]);
Service::create(['name' => 'Buyer', 'color' => Service::$colors[array_rand(Service::$colors)]]);
Method paginatePublishedByIndustry
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function paginatePublishedByIndustry(Industry $industry, $perPage = 10, $columns = ['*'], $pageName = 'page', $page = null)
Method paginateWorkGroups
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function paginateWorkGroups(Industry $industry, $perPage = null, $columns = ['*'], $pageName = 'page', $page = null);
Method paginateWorkGroups
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function paginateWorkGroups(Industry $industry, $perPage = 10, $columns = ['*'], $pageName = 'page', $page = null)
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function __construct(CompanyRepository $companyRepository, UserRepository $userRepository,
IndustryRepository $industryRepository, CountryRepository $countryRepository,
FileRepository $fileRepository)
Avoid too many return
statements within this method. Open
Open
return $next($request);
Avoid too many return
statements within this method. Open
Open
return $next($request);
Function handle
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
public function handle(Request $request, Closure $next, Guard $guard = null)
{
if (Auth::guard($guard)->guest()) {
if ($request->ajax()) {
return response('Unauthorized.', 401);
- 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"