embedded-php/display

View on GitHub
src/Oled/GrayScale/AbstractGrayScaleDisplay.php

Summary

Maintainability
A
2 hrs
Test Coverage

Showing 3 of 3 total issues

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

    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

    There are no issues that match your filters.

    Category
    Status