jndrm/mqtt-packet

View on GitHub
src/Utils/Parser.php

Summary

Maintainability
A
0 mins
Test Coverage

Method detectPacket has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Wontfix

    private static function detectPacket($type)
    {
        switch ($type) {
            case ControlPacketType::CONNECT:
                return new Connect();
Severity: Minor
Found in src/Utils/Parser.php - About 1 hr to fix

Method getCmd has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Wontfix

    public static function getCmd($type)
    {
        switch ($type) {
            case ControlPacketType::CONNECT:
                return 'connect';
Severity: Minor
Found in src/Utils/Parser.php - About 1 hr to fix

Avoid too many return statements within this method.
Invalid

                return new Unsubscribe();
Severity: Major
Found in src/Utils/Parser.php - About 30 mins to fix

Avoid too many return statements within this method.
Invalid

                return 'pingreq';
Severity: Major
Found in src/Utils/Parser.php - About 30 mins to fix

Avoid too many return statements within this method.
Invalid

                return new PingRequest();
Severity: Major
Found in src/Utils/Parser.php - About 30 mins to fix

Avoid too many return statements within this method.
Invalid

                return 'pubrec';
Severity: Major
Found in src/Utils/Parser.php - About 30 mins to fix

Avoid too many return statements within this method.
Invalid

                return 'pubrel';
Severity: Major
Found in src/Utils/Parser.php - About 30 mins to fix

Avoid too many return statements within this method.
Invalid

                return new PublishComplete();
Severity: Major
Found in src/Utils/Parser.php - About 30 mins to fix

Avoid too many return statements within this method.
Invalid

                return new PublishRelease();
Severity: Major
Found in src/Utils/Parser.php - About 30 mins to fix

Avoid too many return statements within this method.
Invalid

                return new UnsubscribeAck();
Severity: Major
Found in src/Utils/Parser.php - About 30 mins to fix

Avoid too many return statements within this method.
Invalid

                return new Disconnect();
Severity: Major
Found in src/Utils/Parser.php - About 30 mins to fix

Avoid too many return statements within this method.
Invalid

                return new PublishReceived();
Severity: Major
Found in src/Utils/Parser.php - About 30 mins to fix

Avoid too many return statements within this method.
Invalid

                return 'unsuback';
Severity: Major
Found in src/Utils/Parser.php - About 30 mins to fix

Avoid too many return statements within this method.
Invalid

                return 'disconnect';
Severity: Major
Found in src/Utils/Parser.php - About 30 mins to fix

Avoid too many return statements within this method.
Invalid

                return 'pubcomp';
Severity: Major
Found in src/Utils/Parser.php - About 30 mins to fix

Avoid too many return statements within this method.
Invalid

                return 'pingresp';
Severity: Major
Found in src/Utils/Parser.php - About 30 mins to fix

Avoid too many return statements within this method.
Invalid

                return new SubscribeAck();
Severity: Major
Found in src/Utils/Parser.php - About 30 mins to fix

Avoid too many return statements within this method.
Invalid

                return 'suback';
Severity: Major
Found in src/Utils/Parser.php - About 30 mins to fix

Avoid too many return statements within this method.
Invalid

                return 'subscribe';
Severity: Major
Found in src/Utils/Parser.php - About 30 mins to fix

Avoid too many return statements within this method.
Invalid

                return 'unsubscribe';
Severity: Major
Found in src/Utils/Parser.php - About 30 mins to fix

Avoid too many return statements within this method.
Invalid

                return 'unknown';
Severity: Major
Found in src/Utils/Parser.php - About 30 mins to fix

Avoid too many return statements within this method.
Invalid

                return new PingResponse();
Severity: Major
Found in src/Utils/Parser.php - About 30 mins to fix

Avoid too many return statements within this method.
Invalid

                return null;
Severity: Major
Found in src/Utils/Parser.php - About 30 mins to fix

Avoid too many return statements within this method.
Invalid

                return new Subscribe();
Severity: Major
Found in src/Utils/Parser.php - About 30 mins to fix

There are no issues that match your filters.

Category
Status