hipay/hipay-wallet-cashout-mirakl-integration

View on GitHub
src/Controller/SettingController.php

Summary

Maintainability
C
1 day
Test Coverage

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

    private function is_writable_r($dir)
    {
        if (is_dir($dir)) {
            if (is_writable($dir)) {
                $objects = scandir($dir);
Severity: Minor
Found in src/Controller/SettingController.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

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

<?php
/**
 * 2017 HiPay
 *
 * NOTICE OF LICENSE
Severity: Minor
Found in src/Controller/SettingController.php - About 2 hrs to fix

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

        private function generateSettingsForm()
        {
    
            $default = array(
                'token' => $this->parameters->offsetGet('github.token'),
    Severity: Minor
    Found in src/Controller/SettingController.php - About 1 hr to fix

      Method generateReRunForm has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private function generateReRunForm()
          {
      
              $default = array(
                  'batch' => array(),
      Severity: Minor
      Found in src/Controller/SettingController.php - About 1 hr to fix

        Method getDefaultSettingsParams has 32 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private function getDefaultSettingsParams()
            {
                $reRunForm = $this->generateReRunForm();
        
                $settingsForm = $this->generateSettingsForm();
        Severity: Minor
        Found in src/Controller/SettingController.php - About 1 hr to fix

          Method reRunAction has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function reRunAction(Request $request)
              {
                  $reRunForm = $this->generateReRunForm();
          
                  $settingsForm = $this->generateSettingsForm();
          Severity: Minor
          Found in src/Controller/SettingController.php - About 1 hr to fix

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

                public function reRunAction(Request $request)
                {
                    $reRunForm = $this->generateReRunForm();
            
                    $settingsForm = $this->generateSettingsForm();
            Severity: Minor
            Found in src/Controller/SettingController.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 __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                public function __construct($formBuilder, \Twig_Environment $twig, $translator, $parameters, $urlGenerator)
            Severity: Minor
            Found in src/Controller/SettingController.php - About 35 mins to fix

              There are no issues that match your filters.

              Category
              Status