klein0r/magento-language-routes

View on GitHub

Showing 9 of 9 total issues

Method _prepareForm has 86 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function _prepareForm()
    {
        /*
         * Checking if user have permissions to save information
         */

    Method _prepareColumns has 77 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function _prepareColumns()
        {
            $this->addColumn(
                'entity_id',
                array(

      Method saveinlineAction has 70 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function saveinlineAction()
          {
              if (Mage::helper('mk_languageroutes')->isInlineTranslationEnabled()) {
                  $returlUrl = $this->getRequest()->getParam('current_url', false);
                  $storeId = $this->getRequest()->getParam('store_id', false);

        Function saveinlineAction has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
        Open

            public function saveinlineAction()
            {
                if (Mage::helper('mk_languageroutes')->isInlineTranslationEnabled()) {
                    $returlUrl = $this->getRequest()->getParam('current_url', false);
                    $storeId = $this->getRequest()->getParam('store_id', false);

        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 getAvailableControllers has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            public function getAvailableControllers()
            {
                $allModules = Mage::getConfig()->getNode('modules')->children();
        
                $controllers = array();
        Severity: Minor
        Found in app/code/community/MKleine/LanguageRoutes/Helper/Data.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 editAction has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function editAction()
            {
                $id = $this->getRequest()->getParam('id', 0);
                $model = Mage::getModel('mk_languageroutes/languageroute')->load($id);
        
        

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

              public function getTranslatedPath()
              {
                  /** @var $request Zend_Controller_Request_Http */
                  if ($request = $this->getRequest()) {
                      $pathInfo = explode('/', $request->getPathInfo(), 5);
          Severity: Minor
          Found in app/code/community/MKleine/LanguageRoutes/Model/Translation.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 _prepareForm has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              protected function _prepareForm()
              {
                  /*
                   * Checking if user have permissions to save information
                   */

          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 massDeleteAction has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              public function massDeleteAction()
              {
                  $languagerouteIds = $this->getRequest()->getParam('languageroute');
          
                  if (!is_array($languagerouteIds)) {

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Severity
          Category
          Status
          Source
          Language