antaresproject/core

View on GitHub

Showing 265 of 306 total issues

Method build has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function build(Grid &$grid)
    {
        $attributes = array_merge($this->attributes, $grid->ajaxable);
        $inputs     = [];
        $fieldsets  = $grid->fieldsets();
Severity: Minor
Found in src/components/html/src/Builder/AjaxValidation.php - About 1 hr to fix

    Method resolveFieldValue has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function resolveFieldValue($name, $row, Fluent $control)
        {
            if (ends_with($name, '[]')) {
                $fieldnameInRequest = str_replace('[]', '', $name);
                $oldRequest         = $this->request->old($fieldnameInRequest);
    Severity: Minor
    Found in src/components/html/src/Form/Control.php - About 1 hr to fix

      Method verify has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function verify(array $items = [], $brandId = null)
          {
      
              $items   = $this->clear($items);
              $changed = [];
      Severity: Minor
      Found in src/components/memory/src/Component/ComponentHandler.php - About 1 hr to fix

        Method up has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function up()
            {
                $this->down();
        
                /**

          Function setEngineInstance has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

              public function setEngineInstance(&$engine)
              {
                  $filters = array_get($engine->getColumnDef(), 'filter', []);
                  $values  = $this->getSessionValue();
                  if (!$values) {
          Severity: Minor
          Found in src/ui/components/datatables/src/Adapter/GroupsFilterAdapter.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 add has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

              public function add($name, $source, $dependencies = [], $attributes = [], $replaces = [])
              {
                  if (!is_null($from      = array_get($attributes, 'from')) && !is_null($extension = extensions($from))) {
                      $extensions = app('antares.extension')->getAvailableExtensions();
                      $path       = null;
          Severity: Minor
          Found in src/utils/asset/src/Asset.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 publishAndPropagate has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

              public function publishAndPropagate(array $files = array(), $extension = null, $before = [])
              {
                  $container = $this->assetFactory->container($this->position);
                  if (empty($files)) {
                      return $container;
          Severity: Minor
          Found in src/utils/asset/src/AssetPublisher.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 build has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

              public function build(Grid &$grid)
              {
                  $attributes = array_merge($this->attributes, $grid->ajaxable);
                  $inputs     = [];
                  $fieldsets  = $grid->fieldsets();
          Severity: Minor
          Found in src/components/html/src/Builder/AjaxValidation.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 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

          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 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 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

          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 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 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 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 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 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
                        Severity
                        Category
                        Status
                        Source
                        Language