[thermostat-device-addon] Splitting virtual connector part to addon (… #76
ci.yaml
on: push
Matrix: Code quality assurance
Matrix: Code static analysis
Matrix: Code linting
Matrix: Test for mutants
Matrix: Code tests
Matrix: Code tests with code coverage
Annotations
10 warnings
Test for mutants (8.2, ubuntu-latest):
src/API/Crypto.php#L60
Escaped Mutant for Mutator "CastArray":
--- Original
+++ New
@@ @@
{
try {
// Start with 12 random bytes
- $message = pack('C*', ...(array) unpack('C*', random_bytes(12)));
+ $message = pack('C*', ...unpack('C*', random_bytes(12)));
} catch (Throwable $ex) {
throw new Exceptions\Encrypt('Preparing payload header failed', $ex->getCode(), $ex);
}
|
Test for mutants (8.2, ubuntu-latest):
src/API/Crypto.php#L81
Escaped Mutant for Mutator "FalseValue":
--- Original
+++ New
@@ @@
$message = $message . str_repeat(chr(0), 16 - strlen($message) % 16);
// Encrypt the payload
$cipherText = openssl_encrypt($message, 'AES-128-CBC', $key, OPENSSL_RAW_DATA | OPENSSL_ZERO_PADDING, $iv);
- if ($cipherText === false) {
+ if ($cipherText === true) {
throw new Exceptions\Encrypt('Payload could not be encrypted');
}
// Compute HMAC-SHA-256
|
Test for mutants (8.2, ubuntu-latest):
src/API/Crypto.php#L99
Escaped Mutant for Mutator "FalseValue":
--- Original
+++ New
@@ @@
public static function decryptPayload(string $data, string $key, string $iv, string $hmacKey) : string
{
$decodedWithSignature = base64_decode($data, true);
- if ($decodedWithSignature === false) {
+ if ($decodedWithSignature === true) {
throw new Exceptions\Decrypt('Payload could not be decoded');
}
$decoded = substr($decodedWithSignature, 0, -self::SIGNATURE_BYTES_LENGTH);
|
Test for mutants (8.2, ubuntu-latest):
src/API/Crypto.php#L120
Escaped Mutant for Mutator "FalseValue":
--- Original
+++ New
@@ @@
throw new Exceptions\Decrypt('Payload could not be decrypted. Signatures are different');
}
$result = openssl_decrypt($decoded, 'AES-128-CBC', $key, OPENSSL_RAW_DATA | OPENSSL_ZERO_PADDING, $iv);
- if ($result === false) {
+ if ($result === true) {
throw new Exceptions\Decrypt('Payload could not be decrypted');
}
$decrypted = unpack('C*', $result);
|
Test for mutants (8.2, ubuntu-latest):
src/API/Crypto.php#L126
Escaped Mutant for Mutator "FalseValue":
--- Original
+++ New
@@ @@
throw new Exceptions\Decrypt('Payload could not be decrypted');
}
$decrypted = unpack('C*', $result);
- if ($decrypted === false) {
+ if ($decrypted === true) {
throw new Exceptions\Decrypt('Payload could not be decrypted');
}
$decrypted = array_values($decrypted);
|
Test for mutants (8.2, ubuntu-latest):
src/API/Crypto.php#L135
Escaped Mutant for Mutator "LessThan":
--- Original
+++ New
@@ @@
$decrypted = array_values($decrypted);
$message = [];
// The valid decrypted data starts at byte offset 16
- for ($i = 16; $i < count($decrypted); $i++) {
+ for ($i = 16; $i <= count($decrypted); $i++) {
// Strip ending
if ($decrypted[$i] === 0) {
break;
|
Test for mutants (8.2, ubuntu-latest):
src/API/Crypto.php#L138
Escaped Mutant for Mutator "Break_":
--- Original
+++ New
@@ @@
for ($i = 16; $i < count($decrypted); $i++) {
// Strip ending
if ($decrypted[$i] === 0) {
- break;
+ continue;
}
$message[] = $decrypted[$i];
}
|
Test for mutants (8.2, ubuntu-latest):
src/Commands/Discover.php#L86
Escaped Mutant for Mutator "MethodCallRemoval":
--- Original
+++ New
@@ @@
private DateTimeInterface|null $executedTime = null;
public function __construct(private readonly Api\TelevisionApiFactory $televisionApiFactory, private readonly Helpers\Device $deviceHelper, private readonly Viera\Logger $logger, private readonly DevicesModels\Entities\Devices\Properties\PropertiesRepository $devicesPropertiesRepository, private readonly DevicesModels\Entities\Devices\Properties\PropertiesManager $devicesPropertiesManager, private readonly DevicesModels\Configuration\Connectors\Repository $connectorsConfigurationRepository, private readonly DevicesModels\Configuration\Devices\Repository $devicesConfigurationRepository, private readonly DateTimeFactory\Factory $dateTimeFactory, private readonly Localization\Translator $translator, string|null $name = null)
{
- parent::__construct($name);
+
}
/**
* @throws Console\Exception\InvalidArgumentException
|
Test for mutants (8.2, ubuntu-latest):
src/Commands/Discover.php#L94
Escaped Mutant for Mutator "MethodCallRemoval":
--- Original
+++ New
@@ @@
*/
protected function configure() : void
{
- $this->setName(self::NAME)->setDescription('Viera connector discovery')->setDefinition(new Input\InputDefinition([new Input\InputOption('connector', 'c', Input\InputOption::VALUE_OPTIONAL, 'Connector ID or identifier', true)]));
+
}
/**
* @throws Console\Exception\ExceptionInterface
|
Test for mutants (8.2, ubuntu-latest):
src/Commands/Discover.php#L98
Escaped Mutant for Mutator "ArrayItemRemoval":
--- Original
+++ New
@@ @@
*/
protected function configure() : void
{
- $this->setName(self::NAME)->setDescription('Viera connector discovery')->setDefinition(new Input\InputDefinition([new Input\InputOption('connector', 'c', Input\InputOption::VALUE_OPTIONAL, 'Connector ID or identifier', true)]));
+ $this->setName(self::NAME)->setDescription('Viera connector discovery')->setDefinition(new Input\InputDefinition([]));
}
/**
* @throws Console\Exception\ExceptionInterface
|
Artifacts
Produced during runtime
Name | Size | |
---|---|---|
Logs - Mutations
Expired
|
3.13 MB |
|