wherebyus/OptinService

View on GitHub

Showing 7 of 7 total issues

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

class Optin
{
    private $active;
    private $authorId;
    private $backgroundColor;
Severity: Minor
Found in app/Models/Optin.php - About 3 hrs to fix

    File OptinRepository.php has 280 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    namespace WBU\Http\Repositories;
    
    use WBU\BooleanConstants;
    Severity: Minor
    Found in app/Http/Repositories/OptinRepository.php - About 2 hrs to fix

      Method getOptinsByPageId has 61 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function getOptinsByPageId() : array
          {
              if (!function_exists('get_the_ID')) {
                  return [];
              }
      Severity: Major
      Found in app/Http/Repositories/OptinRepository.php - About 2 hrs to fix

        Method getOptinById has 56 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function getOptinById(int $id) : OptinDto
            {
                global $wpdb;
        
                $metaKeyBackgroundColor = self::POSTMETA_KEY_BACKGROUND_COLOR;
        Severity: Major
        Found in app/Http/Repositories/OptinRepository.php - About 2 hrs to fix

          Method updateOptin has 14 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                  int $optinId,
                  bool $active,
                  int $authorId,
                  string $backgroundColor,
                  int $conversions,
          Severity: Major
          Found in app/Http/Services/OptinService.php - About 1 hr to fix

            Method updateOptin has 14 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                    int $optinId,
                    bool $active,
                    int $authorId,
                    string $backgroundColor,
                    int $conversions,
            Severity: Major
            Found in app/Http/Services/OptinServiceInterface.php - About 1 hr to fix

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

                  public function updateOptin(OptinDto $dto) : int
                  {
                      if (! function_exists('wp_insert_post')) {
                          return -1;
                      }
              Severity: Minor
              Found in app/Http/Repositories/OptinRepository.php - About 1 hr to fix
                Severity
                Category
                Status
                Source
                Language