antaresproject/core

View on GitHub

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 = [
Severity: Minor
Found in src/foundation/src/Support/Providers/ModuleServiceProvider.php - About 1 hr to fix

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.'));
        }
Severity: Minor
Found in src/components/extension/src/Processors/Composer.php - About 1 hr to fix

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) {
Severity: Minor
Found in src/components/memory/src/Component/ComponentHandler.php - About 1 hr to fix

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();
Severity: Minor
Found in src/foundation/src/Http/Datatables/Extensions.php - About 1 hr to fix

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');

Severity: Minor
Found in src/components/publisher/src/MigrateManager.php - About 1 hr to fix

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;
    Severity: Minor
    Found in src/components/html/src/Events/BeforeFormRender.php - About 1 hr to fix

      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)) {
      Severity: Minor
      Found in src/ui/components/templates/src/Twig/Component.php - About 1 hr to fix

        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);
                });
        Severity: Minor
        Found in src/utils/twig/Extension/Avatar.php - About 1 hr to fix

          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));
          Severity: Minor
          Found in src/utils/twig/Extension/Avatar.php - About 1 hr to fix

            Method boot has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function boot()
                {
            
                    $path = realpath(__DIR__ . '/../resources');
            
            
            Severity: Minor
            Found in src/components/html/src/HtmlServiceProvider.php - About 1 hr to fix

              Method detectUiComponents has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  protected function detectUiComponents()
                  {
                      $components  = [];
                      $factory     = app('antares.extension');
                      $directories = [];
              Severity: Minor
              Found in src/ui/components/templates/src/Finder.php - About 1 hr to fix

                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));
                
                
                Severity: Minor
                Found in src/utils/asset/src/Asset.php - About 1 hr to fix

                  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'))) {
                  Severity: Minor
                  Found in src/components/html/src/Form/ClientScript.php - About 1 hr to fix

                    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();
                    Severity: Minor
                    Found in src/components/memory/src/Model/Permission.php - About 1 hr to fix

                      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();
                        Severity: Minor
                        Found in src/foundation/src/Processor/FilterProcessor.php - About 1 hr to fix

                          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);
                          Severity: Minor
                          Found in src/foundation/src/helpers.php - About 1 hr to fix

                            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)
                            Severity: Major
                            Found in src/ui/components/datatables/src/Html/Builder.php - About 1 hr to fix

                              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
                              Severity: Major
                              Found in src/components/extension/src/Processors/Installer.php - About 1 hr to fix
                                Severity
                                Category
                                Status
                                Source
                                Language