abhi1693/yii2-app-advanced-startup-kit

View on GitHub

Showing 8 of 18 total issues

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

    public static function getMenuItems()
    {
        $menuItems = NULL;
        $menuItemPresets = [
            'user' => [
Severity: Major
Found in backend/controllers/admin/SettingController.php - About 2 hrs to fix

    Function actionDatabase has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
    Open

        public function actionDatabase()
        {
            $config = Configuration::get();
            $param = Configuration::getParam();
    
    
    Severity: Minor
    Found in backend/controllers/admin/SettingController.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

    File SettingController.php has 256 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /**
     * Created by PhpStorm.
     * User: Abhimanyu
     * Date: 18-02-2015
    Severity: Minor
    Found in backend/controllers/admin/SettingController.php - About 2 hrs to fix

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

          public function actionDatabase()
          {
              $config = Configuration::get();
              $param = Configuration::getParam();
      
      
      Severity: Minor
      Found in backend/controllers/admin/SettingController.php - About 1 hr to fix

        Method actionMail has 34 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function actionMail()
            {
                $model = new MailFormSetting();
                $model->mailUseTransport = Yii::$app->config->get(Enum::MAILER_USE_TRANSPORT) === 'true' ? '1' : '0';
        
        
        Severity: Minor
        Found in backend/controllers/admin/SettingController.php - About 1 hr to fix

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

              public function actionMail()
              {
                  $model = new MailFormSetting();
                  $model->mailUseTransport = Yii::$app->config->get(Enum::MAILER_USE_TRANSPORT) === 'true' ? '1' : '0';
          
          
          Severity: Minor
          Found in backend/controllers/admin/SettingController.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 actionContact has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              public function actionContact()
              {
                  $model = new ContactForm();
                  if ($model->load(Yii::$app->request->post()) && $model->validate()) {
                      if ($model->sendEmail(Yii::$app->params['adminEmail'])) {
          Severity: Minor
          Found in frontend/controllers/SiteController.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 init has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              public function init()
              {
                  parent::init();
          
                  $session = \Yii::$app->getSession();
          Severity: Minor
          Found in frontend/widgets/Alert.php - About 25 mins to fix

          Cognitive Complexity

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

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

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

          Further reading

          Severity
          Category
          Status
          Source
          Language