Passed
Push — main ( 275957...473697 )
by PRATIK
04:03
created

Sidebar::initializeMenu()   B

Complexity

Conditions 8
Paths 128

Size

Total Lines 126
Code Lines 74

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 1 Features 0
Metric Value
cc 8
eloc 74
nc 128
nop 0
dl 0
loc 126
rs 7.1361
c 2
b 1
f 0

How to fix   Long Method   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php
2
3
namespace Pratiksh\Adminetic\View\Components;
4
5
use Adminetic;
0 ignored issues
show
Bug introduced by
The type Adminetic was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
use Illuminate\View\Component;
7
8
class Sidebar extends Component
9
{
10
11
    /**
12
     * Get the view / contents that represent the component.
13
     *
14
     * @return \Illuminate\Contracts\View\View|\Closure|string
15
     */
16
    public function render()
17
    {
18
        $menus = Adminetic::menus() ?? array();
19
20
        return view('adminetic::components.sidebar', compact('menus'));
21
    }
22
}
23