vragovR/omnidesk-bundle

View on GitHub

Showing 19 of 75 total issues

Cases has 34 functions (exceeds 20 allowed). Consider refactoring.
Open

class Cases
{
    /**
     * @var string
     */
Severity: Minor
Found in src/Model/Cases.php - About 4 hrs to fix

    User has 30 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class User
    {
        /**
         * @var int
         */
    Severity: Minor
    Found in src/Model/User.php - About 3 hrs to fix

      Method getConfigTreeBuilder has 85 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function getConfigTreeBuilder()
          {
              $treeBuilder = new TreeBuilder();
      
              $rootNode = $treeBuilder->root('params');
      Severity: Major
      Found in src/Configuration/Cases/ListCasesRequestConfiguration.php - About 3 hrs to fix

        ListCasesRequest has 28 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class ListCasesRequest implements RequestInterface
        {
            /**
             * @var string
             */
        Severity: Minor
        Found in src/Request/Cases/ListCasesRequest.php - About 3 hrs to fix

          AddCasesRequest has 27 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class AddCasesRequest implements RequestInterface
          {
              /**
               * @var string
               */
          Severity: Minor
          Found in src/Request/Cases/AddCasesRequest.php - About 3 hrs to fix

            Method getConfigTreeBuilder has 53 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function getConfigTreeBuilder()
                {
                    $treeBuilder = new TreeBuilder();
            
                    $rootNode = $treeBuilder->root('params');
            Severity: Major
            Found in src/Configuration/Cases/AddCasesRequestConfiguration.php - About 2 hrs to fix

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

                  public function getConfigTreeBuilder()
                  {
                      $treeBuilder = new TreeBuilder();
              
                      $rootNode = $treeBuilder->root('params');
              Severity: Minor
              Found in src/Configuration/Cases/EditCasesRequestConfiguration.php - About 1 hr to fix

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

                    public function postMultipart($url, $name, array $params = [])
                    {
                        $multipart = [];
                
                        foreach ($params as $key => $param) {
                Severity: Minor
                Found in src/Service/RequestService.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 getConfigTreeBuilder has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function getConfigTreeBuilder()
                    {
                        $treeBuilder = new TreeBuilder();
                
                        $rootNode = $treeBuilder->root('params');
                Severity: Minor
                Found in src/Configuration/User/AddUserRequestConfiguration.php - About 1 hr to fix

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

                      public function getConfigTreeBuilder()
                      {
                          $treeBuilder = new TreeBuilder();
                  
                          $rootNode = $treeBuilder->root('params');
                  Severity: Minor
                  Found in src/Configuration/User/EditUserRequestConfiguration.php - About 1 hr to fix

                    Method postMultipart has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function postMultipart($url, $name, array $params = [])
                        {
                            $multipart = [];
                    
                            foreach ($params as $key => $param) {
                    Severity: Minor
                    Found in src/Service/RequestService.php - About 1 hr to fix

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

                          public function getConfigTreeBuilder()
                          {
                              $treeBuilder = new TreeBuilder();
                      
                              $rootNode = $treeBuilder->root('params');
                      Severity: Minor
                      Found in src/Configuration/User/ListUserRequestConfiguration.php - About 1 hr to fix

                        Method __construct has 6 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                                AddStaffRequestDataTransformer $addRequest,
                                EditStaffRequestDataTransformer $editRequest,
                                ListStaffRequestDataTransformer $listRequest,
                                ViewStaffRequestDataTransformer $viewRequest,
                                ListStaffResponseDataTransformer $listResponse,
                        Severity: Minor
                        Found in src/Factory/Staff/StaffDataTransformerFactory.php - About 45 mins to fix

                          Method __construct has 6 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                                  AddCasesRequestDataTransformer $addRequest,
                                  EditCasesRequestDataTransformer $editRequest,
                                  ListCasesRequestDataTransformer $listRequest,
                                  ViewCasesRequestDataTransformer $viewRequest,
                                  ListCasesResponseDataTransformer $listResponse,
                          Severity: Minor
                          Found in src/Factory/Cases/CasesDataTransformerFactory.php - About 45 mins to fix

                            Method __construct has 6 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                    AddGroupRequestDataTransformer $addRequest,
                                    EditGroupRequestDataTransformer $editRequest,
                                    ListGroupRequestDataTransformer $listRequest,
                                    ViewGroupRequestDataTransformer $viewRequest,
                                    ListGroupResponseDataTransformer $listResponse,
                            Severity: Minor
                            Found in src/Factory/Group/GroupDataTransformerFactory.php - About 45 mins to fix

                              Method __construct has 6 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                      AddUserRequestDataTransformer $addRequest,
                                      EditUserRequestDataTransformer $editRequest,
                                      ListUserRequestDataTransformer $listRequest,
                                      ViewUserRequestDataTransformer $viewRequest,
                                      ListUserResponseDataTransformer $listResponse,
                              Severity: Minor
                              Found in src/Factory/User/UserDataTransformerFactory.php - About 45 mins to fix

                                Avoid too many return statements within this method.
                                Open

                                                return $this->listResponse;
                                Severity: Major
                                Found in src/Factory/AbstractDataTransformerFactory.php - About 30 mins to fix

                                  Avoid too many return statements within this method.
                                  Open

                                                  return $this->viewResponse;
                                  Severity: Major
                                  Found in src/Factory/AbstractDataTransformerFactory.php - About 30 mins to fix

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

                                        public function add(AddMessageRequest $request)
                                        {
                                            $transformer = $this->transformerFactory->get(MessageDataTransformerFactory::REQUEST_ADD);
                                            $configuration = $this->configurationFactory->get(MessageConfigurationFactory::CONFIGURATION_ADD);
                                    
                                    
                                    Severity: Minor
                                    Found in src/Service/MessageService.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