Showing 306 of 306 total issues
Function loadRoutes
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected function loadRoutes()
{
$path = $this->extensionPath;
$routes = [
- 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 run
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function run(OperationHandlerContract $handler, array $extensionsNames)
{
if (count($extensionsNames) === 0) {
return $handler->operationInfo(new Operation('No extensions to install. Skipping composer.'));
}
- 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 initiate
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function initiate()
{
$items = [];
$memories = $this->cache instanceof Repository ? $this->getItemsFromCache() : $this->getItemsFromDatabase();
foreach ($memories as $key => $value) {
- 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 getActionsColumn
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected function getActionsColumn(Authorization $acl): Closure
{
return function(ExtensionContract $extension) use($acl) {
$buttons = [];
$name = $extension->getPackage()->getName();
- 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 seed
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function seed($name, $paths = null)
{
$directories = is_null($paths) ? $this->getPaths($name, 'seeds') : $paths;
$files = $this->app->make('files');
- 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 addMockConnection
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addMockConnection(Model $model)
{
$resolver = m::mock('\Illuminate\Database\ConnectionResolverInterface');
$model->setConnectionResolver($resolver);
$connection = m::mock('\Illuminate\Database\Connection');
Method handle
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handle(GridContract $grid)
{
$runtime = Memory::make('runtime')->get('control');
if (is_null($runtime)) {
return false;
Method componentForced
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function componentForced()
{
$function = function ($name = null, array $params = []) {
if (is_null($name)) {
Method getFunctions
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getFunctions()
{
$avatar = new Twig_SimpleFunction('avatar', function ($name, $type, $width = 40, $height = 40) {
return $this->show($name, $type, $width, $height);
});
Method show
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function show($param, $type = null, $width = 40, $height = 40, $widget = false)
{
$filename = public_path('avatars/' . implode('_', [$type, (is_numeric($param) ? $param : camel_case($param)), $width, $height]) . '.png');
if (!$this->filesystem->exists(dirname($filename))) {
$this->filesystem->makeDirectory(dirname($filename));
Method boot
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function boot()
{
$path = realpath(__DIR__ . '/../resources');
Method detectUiComponents
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function detectUiComponents()
{
$components = [];
$factory = app('antares.extension');
$directories = [];
Method webpack
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function webpack()
{
$scripts = array_merge(['/packages/core/js/on-load.js', '/packages/core/js/datatable-helpers.js'], $this->dispatcher->scripts('script', $this->assets, $this->path));
Method attachRules
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function attachRules(&$grid, array $rules = null)
{
$fieldsets = $grid->fieldsets();
if (!empty(Input::get('ajax')) && Request::ajax() && !is_null($key = Input::get('key'))) {
Method getAll
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getAll($brandId = null)
{
$columns = ['id', 'vendor', 'name', 'status', 'actions', 'permissions', 'options'];
$builder = (!is_null($brandId)) ? static::select($columns)->where('brand_id', '=', $brandId)->orWhere('brand_id') : static::select($columns);
$models = $builder->with(['attachedActions'])->get();
Method createPermissionsTbl
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function createPermissionsTbl()
{
Schema::create('tbl_permissions', function (Blueprint $table) {
$table->increments('id')->unsigned();
$table->integer('brand_id')->unsigned();
Method update
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function update()
{
$inputs = Input::all();
$s = $this->request->session();
$route = uri();
Method wrap_html
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function wrap_html($str, $size = 50, $splitter = '<br />')
{
$html = false;
$i = 0;
$chars = str_split($str);
Method __construct
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct(Repository $config, Factory $view, HtmlBuilder $html, UrlGenerator $url, FormBuilder $form, FilterAdapter $filterAdapter, Router $router, Dispatcher $dispatcher)
Method __construct
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
ComposerHandler $composerHandler, ExtensionValidator $extensionValidator, Container $container, Dispatcher $dispatcher, Kernel $kernel, ExtensionsRepository $extensionsRepository, SettingsFactory $settingsFactory, ComponentsRepository $componentsRepository