luyadev/luya-module-admin

View on GitHub

Showing 503 of 503 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

            return '' +
                '<div class="form-group form-side-by-side zaa-datetime" ng-class="{\'input--hide-label\': i18n, \'input--with-time\': model!=null && date!=null}">' +
                '<div class="form-side form-side-label">' +
                '<label>{{label}}</label>' +
                '</div>' +
Severity: Major
Found in src/resources/js/formdirectives.js and 1 other location - About 4 hrs to fix
src/resources/js/formdirectives.js on lines 2529..2559

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 121.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

            return '' +
                '<div class="form-group form-side-by-side" ng-class="{\'input--hide-label\': i18n}">' +
                '<div class="form-side form-side-label">' +
                '<label ng-if="label">{{label}}</label>' +
                '<label ng-if="!label">Table</label>' +
Severity: Major
Found in src/resources/js/formdirectives.js and 1 other location - About 4 hrs to fix
src/resources/js/formdirectives.js on lines 2291..2321

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 121.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

File StorageController.php has 345 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

namespace luya\admin\apis;

use InvalidArgumentException;
Severity: Minor
Found in src/apis/StorageController.php - About 4 hrs to fix

    Function getOperation has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function getOperation(UrlRule $urlRule, $verbName)
        {
            if (empty($urlRule->verb)) {
                return false;
            }
    Severity: Minor
    Found in src/openapi/UrlRuleRouteParser.php - About 4 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

    File BaseSpecs.php has 337 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    namespace luya\admin\openapi\specs;
    
    use cebe\openapi\spec\Example;
    Severity: Minor
    Found in src/openapi/specs/BaseSpecs.php - About 4 hrs to fix

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

      zaa.directive("zaaSlug", function () {
          return {
              restrict: "E",
              scope: {
                  "model": "=",
      Severity: Major
      Found in src/resources/js/formdirectives.js and 1 other location - About 4 hrs to fix
      src/resources/js/formdirectives.js on lines 940..964

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 116.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

      zaa.directive("zaaText", function () {
          return {
              restrict: "E",
              scope: {
                  "model": "=",
      Severity: Major
      Found in src/resources/js/formdirectives.js and 1 other location - About 4 hrs to fix
      src/resources/js/formdirectives.js on lines 440..464

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 116.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Method getOperation has 96 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function getOperation(UrlRule $urlRule, $verbName)
          {
              if (empty($urlRule->verb)) {
                  return false;
              }
      Severity: Major
      Found in src/openapi/UrlRuleRouteParser.php - About 3 hrs to fix

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

        zaa.directive("zaaWysiwyg", function () {
            return {
                restrict: "E",
                scope: {
                    "model": "=",
        Severity: Major
        Found in src/resources/js/formdirectives.js and 1 other location - About 3 hrs to fix
        src/resources/js/formdirectives.js on lines 1242..1266

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 111.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

        zaa.directive("zaaTextarea", function () {
            return {
                restrict: "E",
                scope: {
                    "model": "=",
        Severity: Major
        Found in src/resources/js/formdirectives.js and 1 other location - About 3 hrs to fix
        src/resources/js/formdirectives.js on lines 642..665

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 111.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

                  , unregisterDateDisabledDatesWatcher = $scope.$watch('dateDisabledDates', function dateDisabledDatesWatcher(newValue) {
                    if (newValue) {
                      dateDisabledDates = $scope.$eval(newValue);
        
                      if (!$scope.isSelectableDate($scope.monthNumber, $scope.year, $scope.day)) {
        src/resources/vendorlibs/angularjs-datepicker/angular-datepicker.js on lines 504..514

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 110.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

                  , unregisterDateEnabledDatesWatcher = $scope.$watch('dateEnabledDates', function dateEnabledDatesWatcher(newValue) {
                    if (newValue) {
                      dateEnabledDates = $scope.$eval(newValue);
        
                      if (!$scope.isSelectableDate($scope.monthNumber, $scope.year, $scope.day)) {
        src/resources/vendorlibs/angularjs-datepicker/angular-datepicker.js on lines 493..503

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 110.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Function actionIndex has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
        Open

            public function actionIndex($query)
            {
                $search = [];
                $module = Yii::$app->getModule('admin');
        
        
        Severity: Minor
        Found in src/apis/SearchController.php - About 3 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

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

        zaa.directive("zaaFileUpload", function () {
            return {
                restrict: "E",
                scope: {
                    "model": "=",
        Severity: Major
        Found in src/resources/js/formdirectives.js and 1 other location - About 3 hrs to fix
        src/resources/js/formdirectives.js on lines 2613..2635

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 106.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

        zaa.directive("zaaImageUpload", function () {
            return {
                restrict: "E",
                scope: {
                    "model": "=",
        Severity: Major
        Found in src/resources/js/formdirectives.js and 1 other location - About 3 hrs to fix
        src/resources/js/formdirectives.js on lines 2581..2603

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 106.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Function controller has 88 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                controller: ['$scope', '$http', '$timeout', 'AdminToastService', function($scope, $http, $timeout, AdminToastService) {
        
                    // toggle window
        
                    $scope.getFirstAttributeKeyAsDefaultValue = function() {
        Severity: Major
        Found in src/resources/js/scheduler.js - About 3 hrs to fix

          Method getParameters has 88 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function getParameters(): array
              {
                  $params = [];
                  if ($this->getReflection() instanceof ReflectionMethod) {
                      foreach ($this->getReflection()->getParameters() as $arg) {
          Severity: Major
          Found in src/openapi/specs/BaseSpecs.php - About 3 hrs to fix

            ActiveWindow has 29 functions (exceeds 20 allowed). Consider refactoring.
            Open

            abstract class ActiveWindow extends BaseActiveResponse implements ViewContextInterface, ActiveWindowInterface, NgRestButtonConditionInterface, NgRestPermissionLevelInterface
            {
                /**
                 * @var string $suffix The suffix to use for all classes
                 */
            Severity: Minor
            Found in src/ngrest/base/ActiveWindow.php - About 3 hrs to fix

              Angular has 29 functions (exceeds 20 allowed). Consider refactoring.
              Open

              class Angular
              {
                  /**
                   * Type Cast values.
                   *
              Severity: Minor
              Found in src/helpers/Angular.php - About 3 hrs to fix

                Item has 29 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class Item extends ItemAbstract implements LinkInterface
                {
                    use LinkTrait;
                
                    /**
                Severity: Minor
                Found in src/file/Item.php - About 3 hrs to fix
                  Severity
                  Category
                  Status
                  Source
                  Language