embedded-php/display

View on GitHub

Showing 6 of 6 total issues

Method __construct has 40 lines of code (exceeds 25 allowed). Consider refactoring.
Open

public function __construct(
ProtocolInterface $protocol,
int $width,
int $height,
int $rotate,
Severity: Minor
Found in src/Device/AbstractDevice.php - About 1 hr to fix

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

    ProtocolInterface $protocol,
    int $width,
    int $height,
    int $rotate,
    string $colorMode,
    Severity: Major
    Found in src/Oled/GrayScale/AbstractGrayScaleDisplay.php - About 50 mins to fix

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

      ProtocolInterface $protocol,
      int $width = 256,
      int $height = 64,
      int $rotate = Rotate::NONE,
      string $colorMode = ColorMode::RGB,
      Severity: Minor
      Found in src/Oled/GrayScale/Ssd1322.php - About 45 mins to fix

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

        ProtocolInterface $protocol,
        int $width,
        int $height,
        int $rotate,
        string $colorMode
        Severity: Minor
        Found in src/Device/AbstractDevice.php - About 35 mins to fix

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

          protected function renderGrayscale(array &$buffer, array $pixelData): void {
          $i = 0;
          foreach ($pixelData as $pixel) {
          // decomposition into rgb components
          $r = ($pixel >> 16) & 0xFF;
          Severity: Minor
          Found in src/Oled/GrayScale/AbstractGrayScaleDisplay.php - About 35 mins to fix

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

          protected function renderMono(array &$buffer, array $pixelData): void {
          $i = 0;
          foreach ($pixelData as $pixel) {
          if ($pixel > 0) {
          $idx = (int)($i / 2);
          Severity: Minor
          Found in src/Oled/GrayScale/AbstractGrayScaleDisplay.php - About 35 mins to fix
          Severity
          Category
          Status
          Source
          Language