tastphp/framework

View on GitHub

Showing 30 of 30 total issues

Function parseResource has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function parseResource($resource, $isCustom)
    {
        $config = [];
        if (true == $isCustom) {
            $configResourceDir = self::$configCacheDir . "/" . substr($resource, 0, -11);
Severity: Minor
Found in src/Framework/Config/ConfigService.php - About 35 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

Avoid too many return statements within this method.
Open

            return $dbs[$app['dbs.default']];
Severity: Major
Found in src/Framework/Doctrine/DoctrineService.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

                return $managers;
    Severity: Major
    Found in src/Framework/Doctrine/DoctrineService.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                  return $dbs[$app['dbs.default']];
      Severity: Major
      Found in src/Framework/Doctrine/DoctrineService.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                    return $dbs[$app['dbs.default']];
        Severity: Major
        Found in src/Framework/Doctrine/DoctrineService.php - About 30 mins to fix

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

              public function offsetGet($id)
              {
                  if (!isset($this->keys[$id])) {
                      $tmpId = ucfirst($id);
                      if (!isset($this->values['serviceProviders'][$tmpId])) {
          Severity: Minor
          Found in src/Framework/Container/Container.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 parseListenerConfig has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              private function parseListenerConfig($listenerConfigAll = [])
              {
                  $array = [];
                  $listenersConfigs = \Config::parse('listeners');
          
          
          Severity: Minor
          Found in src/Framework/ListenerRegister/ListenerRegisterService.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 registerBusinessConfig has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              private function registerBusinessConfig($configs)
              {
                  $businessConfigs = $configs['business_config'];
                  foreach ($businessConfigs as $businessConfig) {
                      if (empty($businessConfig['resource'])) {
          Severity: Minor
          Found in src/Framework/Config/ConfigService.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 registerRoutes has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              public function registerRoutes($app)
              {
                  $routeConfigAll = [];
          
                  $routeCacheDir = __BASEDIR__ . "/var/cache/config/routes";
          Severity: Minor
          Found in src/Framework/Router/RouterServiceProvider.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 onResponseAction has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              public function onResponseAction(Event $event)
              {
                  $response = $event->getResponse();
                  $app = $event->getParameters();
          
          
          Severity: Minor
          Found in src/Framework/Listener/ResponseListener.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