luyadev/luya

View on GitHub

Showing 127 of 133 total issues

Avoid too many return statements within this method.
Open

            return 0;
Severity: Major
Found in core/helpers/XLSXWriter.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

                return 'n_numeric';
    Severity: Major
    Found in core/helpers/XLSXWriter.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                  return $model->addError($attribute, Yii::t('luya', '{attribute} must include at least one uppercase letter.', ['attribute' => $model->getAttributeLabel($attribute)]));
      Severity: Major
      Found in core/validators/StrengthValidator.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                return $this->outputSuccess("Theme files has been created successfully. Please run `".$_SERVER['PHP_SELF']." import` to import the theme into the database.");
        Severity: Major
        Found in core/console/commands/ThemeController.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                      return 'n_date';
          Severity: Major
          Found in core/helpers/XLSXWriter.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                        return 0;
            Severity: Major
            Found in core/helpers/XLSXWriter.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                      return $days + $seconds;
              Severity: Major
              Found in core/helpers/XLSXWriter.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                            return 'n_numeric';
                Severity: Major
                Found in core/helpers/XLSXWriter.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                              return 'n_date';
                  Severity: Major
                  Found in core/helpers/XLSXWriter.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                return 'n_datetime';
                    Severity: Major
                    Found in core/helpers/XLSXWriter.php - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                                  return 'n_date';
                      Severity: Major
                      Found in core/helpers/XLSXWriter.php - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                    return $model->addError($attribute, Yii::t('luya', '{attribute} must include at least one lowercase letter.', ['attribute' => $model->getAttributeLabel($attribute)]));
                        Severity: Major
                        Found in core/validators/StrengthValidator.php - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                  return 'n_auto';
                          Severity: Major
                          Found in core/helpers/XLSXWriter.php - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                        return 'n_numeric';
                            Severity: Major
                            Found in core/helpers/XLSXWriter.php - About 30 mins to fix

                              Function contains has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  public static function contains($needle, $haystack, $strict = false)
                                  {
                                      $needles = (array) $needle;
                                      
                                      $state = false;
                              Severity: Minor
                              Found in core/helpers/StringHelper.php - About 25 mins 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 getRequestRoute has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  public function getRequestRoute()
                                  {
                                      if ($this->_requestRoute !== null) {
                                          return $this->_requestRoute;
                                      }
                              Severity: Minor
                              Found in core/base/ModuleReflection.php - About 25 mins 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 parseRequest has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  public function parseRequest($request)
                                  {
                                      // extra data from request to composition, which changes the pathInfo of the Request-Object.
                                      $resolver = $this->getComposition()->getResolvedPathInfo($request);
                              
                              
                              Severity: Minor
                              Found in core/web/UrlManager.php - About 25 mins 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 callMethodSanitizeArguments has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  public static function callMethodSanitizeArguments($object, $method, array $argumentsList = [])
                                  {
                                      // get class reflection object
                                      $reflection = new ReflectionMethod($object, $method);
                                      // array where the sanitized arguemnts will be stored
                              Severity: Minor
                              Found in core/helpers/ObjectHelper.php - About 25 mins 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 writeSheetHeader has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  public function writeSheetHeader($sheet_name, array $header_types, $col_options = null)
                                  {
                                      if (empty($sheet_name) || empty($header_types) || !empty($this->sheets[$sheet_name])) {
                                          return;
                                      }
                              Severity: Minor
                              Found in core/helpers/XLSXWriter.php - About 25 mins 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 resolveRoute has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  public function resolveRoute($route)
                                  {
                                      $routeParts = explode('/', $route);
                                      foreach ($routeParts as $k => $v) {
                                          if (($k == 0 && $v == $this->id) || (empty($v))) {
                              Severity: Minor
                              Found in core/base/Module.php - About 25 mins 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