antaresproject/core

View on GitHub

Showing 265 of 306 total issues

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

    public function up()
    {
        try {
            $this->down();
            Schema::create('tbl_log_priorities', function(Blueprint $table) {

    QueryBuilderEngine has 21 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class QueryBuilderEngine extends BaseEngine
    {
    
        /**
         * @param \Illuminate\Database\Query\Builder $builder
    Severity: Minor
    Found in src/ui/components/datatables/src/Engines/QueryBuilderEngine.php - About 2 hrs to fix

      Function resolveFieldValue has a Cognitive Complexity of 16 (exceeds 5 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 2 hrs 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 validateSource has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
      Open

          public function validateSource($attribute, $value, $parameters)
          {
              $name      = $value->getClientOriginalName();
              $directory = $value->directory;
              $filename  = $value->filename;
      Severity: Minor
      Found in src/foundation/src/Validation/CustomModule.php - About 2 hrs 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 render has 51 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function render()
          {
              app('antares.asset')->container('antares/foundation::application')->add('webpack_forms_basic', '/webpack/forms_basic.js', ['app_cache']);
              $grid   = $this->grid;
              $action = '';
      Severity: Major
      Found in src/components/html/src/Form/FormBuilder.php - About 2 hrs to fix

        Method validateSource has 51 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function validateSource($attribute, $value, $parameters)
            {
                $name      = $value->getClientOriginalName();
                $directory = $value->directory;
                $filename  = $value->filename;
        Severity: Major
        Found in src/foundation/src/Validation/CustomModule.php - About 2 hrs to fix

          Method filtering has 48 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function filtering()
              {
                  $this->query->where(
                          function ($query) {
                      $globalKeyword = $this->setupKeyword($this->request->keyword());
          Severity: Minor
          Found in src/ui/components/datatables/src/Engines/QueryBuilderEngine.php - About 1 hr to fix

            Method fieldset has 48 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                protected function fieldset()
                {
            
                    return $this->grid->fieldset('user-fieldset', function (Fieldset $fieldset) {
                                $fieldset->control('input:text', 'email')
            Severity: Minor
            Found in src/foundation/src/Http/Form/User.php - About 1 hr to fix

              Method mailer has 48 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  protected function mailer($model)
                  {
              
                      return $this->grid->fieldset(trans('antares/foundation::label.settings.mail'), function (Fieldset $fieldset) use ($model) {
                                  $fieldset->legend('Mail configuration');
              Severity: Minor
              Found in src/foundation/src/Http/Form/Mail.php - About 1 hr to fix

                Function schedule has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                Open

                    protected function schedule(Schedule $schedule)
                    {
                        if (!extension_active('automation')) {
                            return false;
                        }
                Severity: Minor
                Found in src/components/console/src/Kernel.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 ordering has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function ordering()
                    {
                        if ($this->orderCallback) {
                            call_user_func($this->orderCallback, $this->getQueryBuilder());
                
                
                Severity: Minor
                Found in src/ui/components/datatables/src/Engines/QueryBuilderEngine.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 form has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function form(array $configuration = array())
                    {
                
                        Event::fire('antares.forms', 'commands.' . $this->name);
                
                
                Severity: Minor
                Found in src/components/view/src/Console/Command.php - About 1 hr to fix

                  Method getFilters has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function getFilters()
                      {
                          $str = new Twig_SimpleFilter(
                                  'str_*', function ($name) {
                              $arguments = array_slice(func_get_args(), 1);
                  Severity: Minor
                  Found in src/utils/twig/Extension/Foundation.php - About 1 hr to fix

                    Function attachRules has a Cognitive Complexity of 14 (exceeds 5 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

                    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 up has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function up()
                        {
                            $this->down();
                            Schema::create('tbl_widgets', function(Blueprint $table) {
                                $table->increments('id');

                      Method prepareToSave has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          protected function prepareToSave($classname, array $params = [], array $paramsFromSession = null)
                          {
                              $column = $params['column'];
                              $return = [];
                              if (is_null($paramsFromSession)) {
                      Severity: Minor
                      Found in src/foundation/src/Processor/FilterProcessor.php - About 1 hr to fix

                        Function setValueOptions has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function setValueOptions($options): SelectType
                            {
                                if (is_array($options) || $options instanceof \Traversable) {
                                    foreach ($options as $key => $value) {
                                        if (!$value instanceof Option) {
                        Severity: Minor
                        Found in src/utils/form/src/Controls/SelectType.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 customfieldsByFieldset has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function customfieldsByFieldset($grid, $name)
                            {
                                if (!extension_active('customfields')) {
                                    return;
                                }
                        Severity: Minor
                        Found in src/components/html/src/Form/Fieldset.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 resolveUIComponentNamespace has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function resolveUIComponentNamespace($src, $i = 0)
                            {
                                $tokens       = token_get_all($src);
                                $count        = count($tokens);
                                $namespace    = '';
                        Severity: Minor
                        Found in src/ui/components/templates/src/Finder.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 setValueOptions has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function setValueOptions($options): MultiCheckboxType
                            {
                                if (is_array($options) || $options instanceof \Traversable) {
                                    foreach ($options as $key => $value) {
                                        if (!$value instanceof Option) {
                        Severity: Minor
                        Found in src/utils/form/src/Controls/MultiCheckboxType.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

                        Severity
                        Category
                        Status
                        Source
                        Language