GemsTracker/gemstracker-library

View on GitHub
classes/GemsEscort.php

Summary

Maintainability
F
1 wk
Test Coverage

__construct accesses the super-global variable $_SERVER.
Open

    public function __construct($application)
    {
        parent::__construct($application);

        self::$_instanceOfSelf = $this;
Severity: Minor
Found in classes/GemsEscort.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

preDispatch accesses the super-global variable $_POST.
Open

    public function preDispatch(\Zend_Controller_Request_Abstract $request)
    {
        if ($request instanceof \Zend_Controller_Request_Http && $request->isXmlHttpRequest()) {
            $mvc = \Zend_Layout::getMvcInstance();

Severity: Minor
Found in classes/GemsEscort.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

preDispatch accesses the super-global variable $_SERVER.
Open

    public function preDispatch(\Zend_Controller_Request_Abstract $request)
    {
        if ($request instanceof \Zend_Controller_Request_Http && $request->isXmlHttpRequest()) {
            $mvc = \Zend_Layout::getMvcInstance();

Severity: Minor
Found in classes/GemsEscort.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

File GemsEscort.php has 1410 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

/**
 * Project Application Core code
 *
Severity: Major
Found in classes/GemsEscort.php - About 3 days to fix

    GemsEscort has 77 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class GemsEscort extends \MUtil_Application_Escort
    {
        /**
         * Default reception code value
         */
    Severity: Major
    Found in classes/GemsEscort.php - About 1 day to fix

      Function routeShutdown has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring.
      Open

          public function routeShutdown(\Zend_Controller_Request_Abstract $request)
          {
              $loader = $this->getLoader();
      
              // Load the menu. As building the menu can depend on all resources and the request, we do it here.
      Severity: Minor
      Found in classes/GemsEscort.php - About 1 day 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 _initCache has 125 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function _initCache()
          {
              $this->bootstrap('project');
      
              $useCache = $this->getResource('project')->getCache();
      Severity: Major
      Found in classes/GemsEscort.php - About 5 hrs to fix

        Function _layoutCrumbs has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
        Open

            protected function _layoutCrumbs(array $args = null)
            {
                // Must be called after _layoutNavigation()
        
                if ($this->menu && $this->menu->isVisible()) {
        Severity: Minor
        Found in classes/GemsEscort.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

        Function _initCache has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
        Open

            protected function _initCache()
            {
                $this->bootstrap('project');
        
                $useCache = $this->getResource('project')->getCache();
        Severity: Minor
        Found in classes/GemsEscort.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

        Method routeShutdown has 110 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function routeShutdown(\Zend_Controller_Request_Abstract $request)
            {
                $loader = $this->getLoader();
        
                // Load the menu. As building the menu can depend on all resources and the request, we do it here.
        Severity: Major
        Found in classes/GemsEscort.php - About 4 hrs to fix

          Function __construct has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
          Open

              public function __construct($application)
              {
                  parent::__construct($application);
          
                  self::$_instanceOfSelf = $this;
          Severity: Minor
          Found in classes/GemsEscort.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

          Function requestChanged has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
          Open

              public function requestChanged(\Zend_Controller_Request_Abstract $request)
              {
                  if ($this->project->isMultiLocale()) {
                      // Get the choosen language
                      $localeId = \Gems_Cookies::getLocale($request);
          Severity: Minor
          Found in classes/GemsEscort.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

          The class GemsEscort has 62 non-getter- and setter-methods. Consider refactoring GemsEscort to keep number of methods under 25.
          Open

          class GemsEscort extends \MUtil_Application_Escort
          {
              /**
               * Default reception code value
               */
          Severity: Minor
          Found in classes/GemsEscort.php by phpmd

          TooManyMethods

          Since: 0.1

          A class with too many methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

          By default it ignores methods starting with 'get' or 'set'.

          The default was changed from 10 to 25 in PHPMD 2.3.

          Example

          Source https://phpmd.org/rules/codesize.html#toomanymethods

          The class GemsEscort has an overall complexity of 330 which is very high. The configured complexity threshold is 50.
          Open

          class GemsEscort extends \MUtil_Application_Escort
          {
              /**
               * Default reception code value
               */
          Severity: Minor
          Found in classes/GemsEscort.php by phpmd

          The class GemsEscort has 15 public methods. Consider refactoring GemsEscort to keep number of public methods under 10.
          Open

          class GemsEscort extends \MUtil_Application_Escort
          {
              /**
               * Default reception code value
               */
          Severity: Minor
          Found in classes/GemsEscort.php by phpmd

          TooManyPublicMethods

          Since: 0.1

          A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

          By default it ignores methods starting with 'get' or 'set'.

          Example

          Source https://phpmd.org/rules/codesize.html#toomanypublicmethods

          Function postDispatch has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
          Open

              public function postDispatch(\Zend_Controller_Request_Abstract $request)
              {
                  if ($request->isDispatched()) {
                      $headers = $this->project->getResponseHeaders();
                      foreach ($headers as $name => $value) {
          Severity: Minor
          Found in classes/GemsEscort.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

          Function _checkParameters has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
          Open

              protected function _checkParameters(array $params, array $posts)
              {
                  foreach ($params as $key => $value) {
                      $rest = strpbrk($key, '<>=%&"\'`');
                      if (false !== $rest) {
          Severity: Minor
          Found in classes/GemsEscort.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 __construct has 54 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function __construct($application)
              {
                  parent::__construct($application);
          
                  self::$_instanceOfSelf = $this;
          Severity: Major
          Found in classes/GemsEscort.php - About 2 hrs to fix

            Method controllerInit has 44 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function controllerInit(\Zend_Controller_Action $actionController = null)
                {
                    $this->_copyVariables($actionController ? $actionController : $this->controllerAfterAction);
            
                    $this->prepareController();
            Severity: Minor
            Found in classes/GemsEscort.php - About 1 hr to fix

              Method requestChanged has 43 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function requestChanged(\Zend_Controller_Request_Abstract $request)
                  {
                      if ($this->project->isMultiLocale()) {
                          // Get the choosen language
                          $localeId = \Gems_Cookies::getLocale($request);
              Severity: Minor
              Found in classes/GemsEscort.php - About 1 hr to fix

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

                    protected function prepareLayout($layoutFuncs, $layoutArgs)
                    {
                        foreach ($layoutFuncs as $prepare => $type) {
                            if (!$type) {
                                continue;
                Severity: Minor
                Found in classes/GemsEscort.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 _layoutCrumbs has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    protected function _layoutCrumbs(array $args = null)
                    {
                        // Must be called after _layoutNavigation()
                
                        if ($this->menu && $this->menu->isVisible()) {
                Severity: Minor
                Found in classes/GemsEscort.php - About 1 hr to fix

                  Method postDispatch has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function postDispatch(\Zend_Controller_Request_Abstract $request)
                      {
                          if ($request->isDispatched()) {
                              $headers = $this->project->getResponseHeaders();
                              foreach ($headers as $name => $value) {
                  Severity: Minor
                  Found in classes/GemsEscort.php - About 1 hr to fix

                    Function preDispatch has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function preDispatch(\Zend_Controller_Request_Abstract $request)
                        {
                            if ($request instanceof \Zend_Controller_Request_Http && $request->isXmlHttpRequest()) {
                                $mvc = \Zend_Layout::getMvcInstance();
                    
                    
                    Severity: Minor
                    Found in classes/GemsEscort.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 getDatabasePaths has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function getDatabasePaths()
                        {
                            $paths = [];
                    
                            $path = APPLICATION_PATH . '/configs/db';
                    Severity: Minor
                    Found in classes/GemsEscort.php - About 1 hr to fix

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

                          protected function getUiSwitcher($items, $currentId, $elementId, $elementName, $controller, array $args = null, $action = 'change-ui')
                          {
                              $uiSwitch  = \MUtil_Html::create('div', $args, array('id' => $elementId));
                              $params    = $this->request->getparams();
                              unset($params['error_handler']);    // If present, this is an object and causes a warning
                      Severity: Minor
                      Found in classes/GemsEscort.php - About 1 hr to fix

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

                            protected function _checkParameters(array $params, array $posts)
                            {
                                foreach ($params as $key => $value) {
                                    $rest = strpbrk($key, '<>=%&"\'`');
                                    if (false !== $rest) {
                        Severity: Minor
                        Found in classes/GemsEscort.php - About 1 hr to fix

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

                              protected function _initEvent()
                              {
                                  $dispatcher = new \Gems\Event\EventDispatcher();
                          
                                  // Add Gems general Event subscriber.
                          Severity: Minor
                          Found in classes/GemsEscort.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 _initTranslate has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              protected function _initTranslate()
                              {
                                  $this->bootstrap(['event', 'locale']);
                          
                                  $language = $this->locale->getLanguage();
                          Severity: Minor
                          Found in classes/GemsEscort.php - About 1 hr to fix

                            Method includeFile has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                protected function includeFile($fileName)
                                {
                                    $extension = pathinfo($fileName, PATHINFO_EXTENSION);
                            
                                    if (! $extension) {
                            Severity: Minor
                            Found in classes/GemsEscort.php - About 1 hr to fix

                              Method _initLogger has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  protected function _initLogger()
                                  {
                                      $this->bootstrap('project');    // Make sure the project object is available
                                      $logger = \Gems_Log::getLogger();
                              
                              
                              Severity: Minor
                              Found in classes/GemsEscort.php - About 1 hr to fix

                                Method preDispatch has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public function preDispatch(\Zend_Controller_Request_Abstract $request)
                                    {
                                        if ($request instanceof \Zend_Controller_Request_Http && $request->isXmlHttpRequest()) {
                                            $mvc = \Zend_Layout::getMvcInstance();
                                
                                
                                Severity: Minor
                                Found in classes/GemsEscort.php - About 1 hr to fix

                                  Method _layoutLocaleSet has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      protected function _layoutLocaleSet(array $args = null)
                                      {
                                          // LOCALE
                                          $currentUri = base64_encode($this->view->url());
                                          $localeDiv = \MUtil_Html::create('div', $args, array('id' => 'languages'));
                                  Severity: Minor
                                  Found in classes/GemsEscort.php - About 1 hr to fix

                                    Function _layoutOrganizationName has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                        protected function _layoutOrganizationName(array $args = null)
                                        {
                                            if (isset($args['tagName'])) {
                                                $tagName = $args['tagName'];
                                                unset($args['tagName']);
                                    Severity: Minor
                                    Found in classes/GemsEscort.php - About 55 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

                                    Method getUiSwitcher has 7 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                        protected function getUiSwitcher($items, $currentId, $elementId, $elementName, $controller, array $args = null, $action = 'change-ui')
                                    Severity: Major
                                    Found in classes/GemsEscort.php - About 50 mins to fix

                                      Avoid deeply nested control flow statements.
                                      Open

                                                              if (file_exists($languageFilename)) {
                                                                  $this->translate->addTranslation($languageFilename, $localeId);
                                                              }
                                      Severity: Major
                                      Found in classes/GemsEscort.php - About 45 mins to fix

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

                                            protected function _layoutLocaleSet(array $args = null)
                                            {
                                                // LOCALE
                                                $currentUri = base64_encode($this->view->url());
                                                $localeDiv = \MUtil_Html::create('div', $args, array('id' => 'languages'));
                                        Severity: Minor
                                        Found in classes/GemsEscort.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

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

                                            protected function _layoutCss()
                                            {
                                                // Set CSS stylescheet(s)
                                                $projectCss = isset($this->project->css) ? (array) $this->project->css : [];
                                                $projectCss = array_reverse($projectCss);
                                        Severity: Minor
                                        Found in classes/GemsEscort.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

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

                                            public function getModules()
                                            {
                                                if (!$this->moduleSettings && static::$modules) {
                                                    $settings = [];
                                                    foreach(static::$modules as $name=>$settingsClass) {
                                        Severity: Minor
                                        Found in classes/GemsEscort.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 'DEV';
                                        Severity: Major
                                        Found in classes/GemsEscort.php - About 30 mins to fix

                                          Avoid too many return statements within this method.
                                          Open

                                                          return strtoupper(substr(APPLICATION_ENV, 0 , 4));
                                          Severity: Major
                                          Found in classes/GemsEscort.php - About 30 mins to fix

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

                                                protected function _layoutTitle(array $args = null)
                                                {
                                                    if (is_array($args) && array_key_exists('separator', $args)) {
                                                        $separator = $args['separator'];
                                                    } else {
                                            Severity: Minor
                                            Found in classes/GemsEscort.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 _layoutContact has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                            Open

                                                protected function _layoutContact(array $args = null)
                                                {
                                                    if ($this->menu instanceof \Gems_Menu) {
                                                        $menuItem = $this->menu->find(array('controller' => 'contact', 'action' => 'index'));
                                            
                                            
                                            Severity: Minor
                                            Found in classes/GemsEscort.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 _copyVariables has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                            Open

                                                protected function _copyVariables($object)
                                                {
                                                    // Store for _updateVariable
                                                    $this->_copyDestinations[] = $object;
                                            
                                            
                                            Severity: Minor
                                            Found in classes/GemsEscort.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 _layoutProjectName has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                            Open

                                                protected function _layoutProjectName(array $args = null)
                                                {
                                                    if (isset($args['tagName'])) {
                                                        $tagName = $args['tagName'];
                                                        unset($args['tagName']);
                                            Severity: Minor
                                            Found in classes/GemsEscort.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 includeFile has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                            Open

                                                protected function includeFile($fileName)
                                                {
                                                    $extension = pathinfo($fileName, PATHINFO_EXTENSION);
                                            
                                                    if (! $extension) {
                                            Severity: Minor
                                            Found in classes/GemsEscort.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 _initLocale has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                            Open

                                                protected function _initLocale()
                                                {
                                                    $this->bootstrap(array('project', 'session'));
                                            
                                                    // Get the choosen language
                                            Severity: Minor
                                            Found in classes/GemsEscort.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

                                            The method _initCache() has an NPath complexity of 348. The configured NPath complexity threshold is 200.
                                            Open

                                                protected function _initCache()
                                                {
                                                    $this->bootstrap('project');
                                            
                                                    $useCache = $this->getResource('project')->getCache();
                                            Severity: Minor
                                            Found in classes/GemsEscort.php by phpmd

                                            NPathComplexity

                                            Since: 0.1

                                            The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

                                            Example

                                            class Foo {
                                                function bar() {
                                                    // lots of complicated code
                                                }
                                            }

                                            Source https://phpmd.org/rules/codesize.html#npathcomplexity

                                            The method _initCache() has 165 lines of code. Current threshold is set to 100. Avoid really long methods.
                                            Open

                                                protected function _initCache()
                                                {
                                                    $this->bootstrap('project');
                                            
                                                    $useCache = $this->getResource('project')->getCache();
                                            Severity: Minor
                                            Found in classes/GemsEscort.php by phpmd

                                            The class GemsEscort has 2623 lines of code. Current threshold is 1000. Avoid really long classes.
                                            Open

                                            class GemsEscort extends \MUtil_Application_Escort
                                            {
                                                /**
                                                 * Default reception code value
                                                 */
                                            Severity: Minor
                                            Found in classes/GemsEscort.php by phpmd

                                            The method routeShutdown() has 149 lines of code. Current threshold is set to 100. Avoid really long methods.
                                            Open

                                                public function routeShutdown(\Zend_Controller_Request_Abstract $request)
                                                {
                                                    $loader = $this->getLoader();
                                            
                                                    // Load the menu. As building the menu can depend on all resources and the request, we do it here.
                                            Severity: Minor
                                            Found in classes/GemsEscort.php by phpmd

                                            The method routeShutdown() has an NPath complexity of 4752. The configured NPath complexity threshold is 200.
                                            Open

                                                public function routeShutdown(\Zend_Controller_Request_Abstract $request)
                                                {
                                                    $loader = $this->getLoader();
                                            
                                                    // Load the menu. As building the menu can depend on all resources and the request, we do it here.
                                            Severity: Minor
                                            Found in classes/GemsEscort.php by phpmd

                                            NPathComplexity

                                            Since: 0.1

                                            The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

                                            Example

                                            class Foo {
                                                function bar() {
                                                    // lots of complicated code
                                                }
                                            }

                                            Source https://phpmd.org/rules/codesize.html#npathcomplexity

                                            The method __construct() has a Cyclomatic Complexity of 13. The configured cyclomatic complexity threshold is 10.
                                            Open

                                                public function __construct($application)
                                                {
                                                    parent::__construct($application);
                                            
                                                    self::$_instanceOfSelf = $this;
                                            Severity: Minor
                                            Found in classes/GemsEscort.php by phpmd

                                            CyclomaticComplexity

                                            Since: 0.1

                                            Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

                                            Example

                                            // Cyclomatic Complexity = 11
                                            class Foo {
                                            1   public function example() {
                                            2       if ($a == $b) {
                                            3           if ($a1 == $b1) {
                                                            fiddle();
                                            4           } elseif ($a2 == $b2) {
                                                            fiddle();
                                                        } else {
                                                            fiddle();
                                                        }
                                            5       } elseif ($c == $d) {
                                            6           while ($c == $d) {
                                                            fiddle();
                                                        }
                                            7        } elseif ($e == $f) {
                                            8           for ($n = 0; $n < $h; $n++) {
                                                            fiddle();
                                                        }
                                                    } else {
                                                        switch ($z) {
                                            9               case 1:
                                                                fiddle();
                                                                break;
                                            10              case 2:
                                                                fiddle();
                                                                break;
                                            11              case 3:
                                                                fiddle();
                                                                break;
                                                            default:
                                                                fiddle();
                                                                break;
                                                        }
                                                    }
                                                }
                                            }

                                            Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

                                            The method _initCache() has a Cyclomatic Complexity of 28. The configured cyclomatic complexity threshold is 10.
                                            Open

                                                protected function _initCache()
                                                {
                                                    $this->bootstrap('project');
                                            
                                                    $useCache = $this->getResource('project')->getCache();
                                            Severity: Minor
                                            Found in classes/GemsEscort.php by phpmd

                                            CyclomaticComplexity

                                            Since: 0.1

                                            Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

                                            Example

                                            // Cyclomatic Complexity = 11
                                            class Foo {
                                            1   public function example() {
                                            2       if ($a == $b) {
                                            3           if ($a1 == $b1) {
                                                            fiddle();
                                            4           } elseif ($a2 == $b2) {
                                                            fiddle();
                                                        } else {
                                                            fiddle();
                                                        }
                                            5       } elseif ($c == $d) {
                                            6           while ($c == $d) {
                                                            fiddle();
                                                        }
                                            7        } elseif ($e == $f) {
                                            8           for ($n = 0; $n < $h; $n++) {
                                                            fiddle();
                                                        }
                                                    } else {
                                                        switch ($z) {
                                            9               case 1:
                                                                fiddle();
                                                                break;
                                            10              case 2:
                                                                fiddle();
                                                                break;
                                            11              case 3:
                                                                fiddle();
                                                                break;
                                                            default:
                                                                fiddle();
                                                                break;
                                                        }
                                                    }
                                                }
                                            }

                                            Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

                                            The method _layoutCrumbs() has a Cyclomatic Complexity of 16. The configured cyclomatic complexity threshold is 10.
                                            Open

                                                protected function _layoutCrumbs(array $args = null)
                                                {
                                                    // Must be called after _layoutNavigation()
                                            
                                                    if ($this->menu && $this->menu->isVisible()) {
                                            Severity: Minor
                                            Found in classes/GemsEscort.php by phpmd

                                            CyclomaticComplexity

                                            Since: 0.1

                                            Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

                                            Example

                                            // Cyclomatic Complexity = 11
                                            class Foo {
                                            1   public function example() {
                                            2       if ($a == $b) {
                                            3           if ($a1 == $b1) {
                                                            fiddle();
                                            4           } elseif ($a2 == $b2) {
                                                            fiddle();
                                                        } else {
                                                            fiddle();
                                                        }
                                            5       } elseif ($c == $d) {
                                            6           while ($c == $d) {
                                                            fiddle();
                                                        }
                                            7        } elseif ($e == $f) {
                                            8           for ($n = 0; $n < $h; $n++) {
                                                            fiddle();
                                                        }
                                                    } else {
                                                        switch ($z) {
                                            9               case 1:
                                                                fiddle();
                                                                break;
                                            10              case 2:
                                                                fiddle();
                                                                break;
                                            11              case 3:
                                                                fiddle();
                                                                break;
                                                            default:
                                                                fiddle();
                                                                break;
                                                        }
                                                    }
                                                }
                                            }

                                            Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

                                            The method requestChanged() has a Cyclomatic Complexity of 13. The configured cyclomatic complexity threshold is 10.
                                            Open

                                                public function requestChanged(\Zend_Controller_Request_Abstract $request)
                                                {
                                                    if ($this->project->isMultiLocale()) {
                                                        // Get the choosen language
                                                        $localeId = \Gems_Cookies::getLocale($request);
                                            Severity: Minor
                                            Found in classes/GemsEscort.php by phpmd

                                            CyclomaticComplexity

                                            Since: 0.1

                                            Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

                                            Example

                                            // Cyclomatic Complexity = 11
                                            class Foo {
                                            1   public function example() {
                                            2       if ($a == $b) {
                                            3           if ($a1 == $b1) {
                                                            fiddle();
                                            4           } elseif ($a2 == $b2) {
                                                            fiddle();
                                                        } else {
                                                            fiddle();
                                                        }
                                            5       } elseif ($c == $d) {
                                            6           while ($c == $d) {
                                                            fiddle();
                                                        }
                                            7        } elseif ($e == $f) {
                                            8           for ($n = 0; $n < $h; $n++) {
                                                            fiddle();
                                                        }
                                                    } else {
                                                        switch ($z) {
                                            9               case 1:
                                                                fiddle();
                                                                break;
                                            10              case 2:
                                                                fiddle();
                                                                break;
                                            11              case 3:
                                                                fiddle();
                                                                break;
                                                            default:
                                                                fiddle();
                                                                break;
                                                        }
                                                    }
                                                }
                                            }

                                            Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

                                            The method postDispatch() has a Cyclomatic Complexity of 14. The configured cyclomatic complexity threshold is 10.
                                            Open

                                                public function postDispatch(\Zend_Controller_Request_Abstract $request)
                                                {
                                                    if ($request->isDispatched()) {
                                                        $headers = $this->project->getResponseHeaders();
                                                        foreach ($headers as $name => $value) {
                                            Severity: Minor
                                            Found in classes/GemsEscort.php by phpmd

                                            CyclomaticComplexity

                                            Since: 0.1

                                            Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

                                            Example

                                            // Cyclomatic Complexity = 11
                                            class Foo {
                                            1   public function example() {
                                            2       if ($a == $b) {
                                            3           if ($a1 == $b1) {
                                                            fiddle();
                                            4           } elseif ($a2 == $b2) {
                                                            fiddle();
                                                        } else {
                                                            fiddle();
                                                        }
                                            5       } elseif ($c == $d) {
                                            6           while ($c == $d) {
                                                            fiddle();
                                                        }
                                            7        } elseif ($e == $f) {
                                            8           for ($n = 0; $n < $h; $n++) {
                                                            fiddle();
                                                        }
                                                    } else {
                                                        switch ($z) {
                                            9               case 1:
                                                                fiddle();
                                                                break;
                                            10              case 2:
                                                                fiddle();
                                                                break;
                                            11              case 3:
                                                                fiddle();
                                                                break;
                                                            default:
                                                                fiddle();
                                                                break;
                                                        }
                                                    }
                                                }
                                            }

                                            Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

                                            The method routeShutdown() has a Cyclomatic Complexity of 28. The configured cyclomatic complexity threshold is 10.
                                            Open

                                                public function routeShutdown(\Zend_Controller_Request_Abstract $request)
                                                {
                                                    $loader = $this->getLoader();
                                            
                                                    // Load the menu. As building the menu can depend on all resources and the request, we do it here.
                                            Severity: Minor
                                            Found in classes/GemsEscort.php by phpmd

                                            CyclomaticComplexity

                                            Since: 0.1

                                            Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

                                            Example

                                            // Cyclomatic Complexity = 11
                                            class Foo {
                                            1   public function example() {
                                            2       if ($a == $b) {
                                            3           if ($a1 == $b1) {
                                                            fiddle();
                                            4           } elseif ($a2 == $b2) {
                                                            fiddle();
                                                        } else {
                                                            fiddle();
                                                        }
                                            5       } elseif ($c == $d) {
                                            6           while ($c == $d) {
                                                            fiddle();
                                                        }
                                            7        } elseif ($e == $f) {
                                            8           for ($n = 0; $n < $h; $n++) {
                                                            fiddle();
                                                        }
                                                    } else {
                                                        switch ($z) {
                                            9               case 1:
                                                                fiddle();
                                                                break;
                                            10              case 2:
                                                                fiddle();
                                                                break;
                                            11              case 3:
                                                                fiddle();
                                                                break;
                                                            default:
                                                                fiddle();
                                                                break;
                                                        }
                                                    }
                                                }
                                            }

                                            Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

                                            The class GemsEscort has a coupling between objects value of 81. Consider to reduce the number of dependencies under 13.
                                            Open

                                            class GemsEscort extends \MUtil_Application_Escort
                                            {
                                                /**
                                                 * Default reception code value
                                                 */
                                            Severity: Minor
                                            Found in classes/GemsEscort.php by phpmd

                                            CouplingBetweenObjects

                                            Since: 1.1.0

                                            A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability

                                            Example

                                            class Foo {
                                                /**
                                                 * @var \foo\bar\X
                                                 */
                                                private $x = null;
                                            
                                                /**
                                                 * @var \foo\bar\Y
                                                 */
                                                private $y = null;
                                            
                                                /**
                                                 * @var \foo\bar\Z
                                                 */
                                                private $z = null;
                                            
                                                public function setFoo(\Foo $foo) {}
                                                public function setBar(\Bar $bar) {}
                                                public function setBaz(\Baz $baz) {}
                                            
                                                /**
                                                 * @return \SplObjectStorage
                                                 * @throws \OutOfRangeException
                                                 * @throws \InvalidArgumentException
                                                 * @throws \ErrorException
                                                 */
                                                public function process(\Iterator $it) {}
                                            
                                                // ...
                                            }

                                            Source https://phpmd.org/rules/design.html#couplingbetweenobjects

                                            The method _initLogger() contains an exit expression.
                                            Open

                                                            die(str_replace(GEMS_ROOT_DIR . '/', '', sprintf(
                                                                    $this->translateAdapter->_('Path %s not writable') . "\n%s\n",
                                                                    $logPath,
                                                                    $exc->getMessage()
                                                                    )));
                                            Severity: Minor
                                            Found in classes/GemsEscort.php by phpmd

                                            ExitExpression

                                            Since: 0.2

                                            An exit-expression within regular code is untestable and therefore it should be avoided. Consider to move the exit-expression into some kind of startup script where an error/exception code is returned to the calling environment.

                                            Example

                                            class Foo {
                                                public function bar($param)  {
                                                    if ($param === 42) {
                                                        exit(23);
                                                    }
                                                }
                                            }

                                            Source https://phpmd.org/rules/design.html#exitexpression

                                            Avoid unused local variables such as '$bootstrap'.
                                            Open

                                                        $bootstrap = \MUtil_Bootstrap::bootstrap(array('fontawesome' => true));
                                            Severity: Minor
                                            Found in classes/GemsEscort.php by phpmd

                                            UnusedLocalVariable

                                            Since: 0.2

                                            Detects when a local variable is declared and/or assigned, but not used.

                                            Example

                                            class Foo {
                                                public function doSomething()
                                                {
                                                    $i = 5; // Unused
                                                }
                                            }

                                            Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

                                            Avoid unused parameters such as '$fullHost'.
                                            Open

                                                public function isAllowedHost($fullHost)
                                            Severity: Minor
                                            Found in classes/GemsEscort.php by phpmd

                                            UnusedFormalParameter

                                            Since: 0.2

                                            Avoid passing parameters to methods or constructors and then not using those parameters.

                                            Example

                                            class Foo
                                            {
                                                private function bar($howdy)
                                                {
                                                    // $howdy is not used
                                                }
                                            }

                                            Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

                                            Avoid unused local variables such as '$name'.
                                            Open

                                                        foreach ($moduleSettings as $name => $settings) {
                                            Severity: Minor
                                            Found in classes/GemsEscort.php by phpmd

                                            UnusedLocalVariable

                                            Since: 0.2

                                            Detects when a local variable is declared and/or assigned, but not used.

                                            Example

                                            class Foo {
                                                public function doSomething()
                                                {
                                                    $i = 5; // Unused
                                                }
                                            }

                                            Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

                                            BUG found
                                            Open

                                                    // FIRE BUG
                                            Severity: Minor
                                            Found in classes/GemsEscort.php by fixme

                                            Avoid excessively long variable names like $maintenanceAccessiblePages. Keep variable name length under 20.
                                            Open

                                                protected $maintenanceAccessiblePages = [
                                                    'index' => ['index', 'login', 'logoff', 'resetpassword'],
                                                    'ask' => ['index', 'forward', 'return', 'token'],
                                                    'contact'=> ['index', 'about', 'gems', 'bugs', 'support'],
                                                ];
                                            Severity: Minor
                                            Found in classes/GemsEscort.php by phpmd

                                            LongVariable

                                            Since: 0.2

                                            Detects when a field, formal or local variable is declared with a long name.

                                            Example

                                            class Something {
                                                protected $reallyLongIntName = -3; // VIOLATION - Field
                                                public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
                                                    $otherReallyLongName = -5; // VIOLATION - Local
                                                    for ($interestingIntIndex = 0; // VIOLATION - For
                                                         $interestingIntIndex < 10;
                                                         $interestingIntIndex++ ) {
                                                    }
                                                }
                                            }

                                            Source https://phpmd.org/rules/naming.html#longvariable

                                            Avoid excessively long variable names like $previousRequestParameters. Keep variable name length under 20.
                                            Open

                                                    if ($this->session->user_id && $previousRequestParameters = $staticSession->previousRequestParameters) {
                                            Severity: Minor
                                            Found in classes/GemsEscort.php by phpmd

                                            LongVariable

                                            Since: 0.2

                                            Detects when a field, formal or local variable is declared with a long name.

                                            Example

                                            class Something {
                                                protected $reallyLongIntName = -3; // VIOLATION - Field
                                                public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
                                                    $otherReallyLongName = -5; // VIOLATION - Local
                                                    for ($interestingIntIndex = 0; // VIOLATION - For
                                                         $interestingIntIndex < 10;
                                                         $interestingIntIndex++ ) {
                                                    }
                                                }
                                            }

                                            Source https://phpmd.org/rules/naming.html#longvariable

                                            Avoid using short method names like GemsEscort::_(). The configured minimum method name length is 3.
                                            Open

                                                public function _($text, $locale = null)
                                                {
                                                    if (! isset($this->request)) {
                                                        // Locale is fixed by request.
                                                        $this->setException(new \Gems_Exception_Coding('Requested translation before request was made available.'));
                                            Severity: Minor
                                            Found in classes/GemsEscort.php by phpmd

                                            ShortMethodName

                                            Since: 0.2

                                            Detects when very short method names are used.

                                            Example

                                            class ShortMethod {
                                                public function a( $index ) { // Violation
                                                }
                                            }

                                            Source https://phpmd.org/rules/naming.html#shortmethodname

                                            Avoid variables with short names like $p. Configured minimum length is 3.
                                            Open

                                                        $p = $div->p();
                                            Severity: Minor
                                            Found in classes/GemsEscort.php by phpmd

                                            ShortVariable

                                            Since: 0.2

                                            Detects when a field, local, or parameter has a very short name.

                                            Example

                                            class Something {
                                                private $q = 15; // VIOLATION - Field
                                                public static function main( array $as ) { // VIOLATION - Formal
                                                    $r = 20 + $this->q; // VIOLATION - Local
                                                    for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                                                        $r += $this->q;
                                                    }
                                                }
                                            }

                                            Source https://phpmd.org/rules/naming.html#shortvariable

                                            Avoid variables with short names like $db. Configured minimum length is 3.
                                            Open

                                                    $db = $resource->getDbAdapter();
                                            Severity: Minor
                                            Found in classes/GemsEscort.php by phpmd

                                            ShortVariable

                                            Since: 0.2

                                            Detects when a field, local, or parameter has a very short name.

                                            Example

                                            class Something {
                                                private $q = 15; // VIOLATION - Field
                                                public static function main( array $as ) { // VIOLATION - Formal
                                                    $r = 20 + $this->q; // VIOLATION - Local
                                                    for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                                                        $r += $this->q;
                                                    }
                                                }
                                            }

                                            Source https://phpmd.org/rules/naming.html#shortvariable

                                            Avoid variables with short names like $db. Configured minimum length is 3.
                                            Open

                                                    $db = $this->getPluginResource('db');
                                            Severity: Minor
                                            Found in classes/GemsEscort.php by phpmd

                                            ShortVariable

                                            Since: 0.2

                                            Detects when a field, local, or parameter has a very short name.

                                            Example

                                            class Something {
                                                private $q = 15; // VIOLATION - Field
                                                public static function main( array $as ) { // VIOLATION - Formal
                                                    $r = 20 + $this->q; // VIOLATION - Local
                                                    for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                                                        $r += $this->q;
                                                    }
                                                }
                                            }

                                            Source https://phpmd.org/rules/naming.html#shortvariable

                                            Avoid variables with short names like $ul. Configured minimum length is 3.
                                            Open

                                                            if ($ul = $menuItem->toUl()) {
                                            Severity: Minor
                                            Found in classes/GemsEscort.php by phpmd

                                            ShortVariable

                                            Since: 0.2

                                            Detects when a field, local, or parameter has a very short name.

                                            Example

                                            class Something {
                                                private $q = 15; // VIOLATION - Field
                                                public static function main( array $as ) { // VIOLATION - Formal
                                                    $r = 20 + $this->q; // VIOLATION - Local
                                                    for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                                                        $r += $this->q;
                                                    }
                                                }
                                            }

                                            Source https://phpmd.org/rules/naming.html#shortvariable

                                            Avoid variables with short names like $e. Configured minimum length is 3.
                                            Open

                                                        $e = new \Gems_Exception_Security($message, $code, null, $info);
                                            Severity: Minor
                                            Found in classes/GemsEscort.php by phpmd

                                            ShortVariable

                                            Since: 0.2

                                            Detects when a field, local, or parameter has a very short name.

                                            Example

                                            class Something {
                                                private $q = 15; // VIOLATION - Field
                                                public static function main( array $as ) { // VIOLATION - Formal
                                                    $r = 20 + $this->q; // VIOLATION - Local
                                                    for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                                                        $r += $this->q;
                                                    }
                                                }
                                            }

                                            Source https://phpmd.org/rules/naming.html#shortvariable

                                            Avoid variables with short names like $i. Configured minimum length is 3.
                                            Open

                                                    $i = 0;
                                            Severity: Minor
                                            Found in classes/GemsEscort.php by phpmd

                                            ShortVariable

                                            Since: 0.2

                                            Detects when a field, local, or parameter has a very short name.

                                            Example

                                            class Something {
                                                private $q = 15; // VIOLATION - Field
                                                public static function main( array $as ) { // VIOLATION - Formal
                                                    $r = 20 + $this->q; // VIOLATION - Local
                                                    for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                                                        $r += $this->q;
                                                    }
                                                }
                                            }

                                            Source https://phpmd.org/rules/naming.html#shortvariable

                                            Avoid variables with short names like $e. Configured minimum length is 3.
                                            Open

                                                public function setException(exception $e)
                                            Severity: Minor
                                            Found in classes/GemsEscort.php by phpmd

                                            ShortVariable

                                            Since: 0.2

                                            Detects when a field, local, or parameter has a very short name.

                                            Example

                                            class Something {
                                                private $q = 15; // VIOLATION - Field
                                                public static function main( array $as ) { // VIOLATION - Formal
                                                    $r = 20 + $this->q; // VIOLATION - Local
                                                    for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                                                        $r += $this->q;
                                                    }
                                                }
                                            }

                                            Source https://phpmd.org/rules/naming.html#shortvariable

                                            The variable $GEMS_DIRS is not named in camelCase.
                                            Open

                                                public function __construct($application)
                                                {
                                                    parent::__construct($application);
                                            
                                                    self::$_instanceOfSelf = $this;
                                            Severity: Minor
                                            Found in classes/GemsEscort.php by phpmd

                                            CamelCaseVariableName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name variables.

                                            Example

                                            class ClassName {
                                                public function doSomething() {
                                                    $data_module = new DataModule();
                                                }
                                            }

                                            Source

                                            The variable $GEMS_DIRS is not named in camelCase.
                                            Open

                                                public function __construct($application)
                                                {
                                                    parent::__construct($application);
                                            
                                                    self::$_instanceOfSelf = $this;
                                            Severity: Minor
                                            Found in classes/GemsEscort.php by phpmd

                                            CamelCaseVariableName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name variables.

                                            Example

                                            class ClassName {
                                                public function doSomething() {
                                                    $data_module = new DataModule();
                                                }
                                            }

                                            Source

                                            The variable $GEMS_DIRS is not named in camelCase.
                                            Open

                                                public function __construct($application)
                                                {
                                                    parent::__construct($application);
                                            
                                                    self::$_instanceOfSelf = $this;
                                            Severity: Minor
                                            Found in classes/GemsEscort.php by phpmd

                                            CamelCaseVariableName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name variables.

                                            Example

                                            class ClassName {
                                                public function doSomething() {
                                                    $data_module = new DataModule();
                                                }
                                            }

                                            Source

                                            The method _ is not named in camelCase.
                                            Open

                                                public function _($text, $locale = null)
                                                {
                                                    if (! isset($this->request)) {
                                                        // Locale is fixed by request.
                                                        $this->setException(new \Gems_Exception_Coding('Requested translation before request was made available.'));
                                            Severity: Minor
                                            Found in classes/GemsEscort.php by phpmd

                                            CamelCaseMethodName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name methods.

                                            Example

                                            class ClassName {
                                                public function get_name() {
                                                }
                                            }

                                            Source

                                            There are no issues that match your filters.

                                            Category
                                            Status