chore(deps): update nginx:alpine docker digest to 582c496 #16
mago.yml
on: pull_request
Mago Quality Checks
13s
Annotations
21 errors, 19 warnings, and 10 notices
|
no-value:
src/SDK/Registry.php#L45
Argument #1 passed to function `is_string` has type `never`, meaning it cannot produce a value.
>This argument expression results in type `never`
The `never` type indicates this expression will not complete to produce a value.
This often occurs in unreachable code, due to impossible conditional logic, or if an expression always exits (e.g., `throw`, `exit()`).
Help: Review preceding logic to ensure this argument can receive a value, or remove if unreachable.
|
|
never-return:
src/SDK/Common/Http/Psr/Client/Discovery/Symfony.php#L32
Cannot return value with type 'never' from this function.
>This expression has type 'never'.
>This return statement is effectively unreachable.
A 'never' return type indicates that a function is guaranteed to exit the script, throw an exception, or loop indefinitely. Code following a call to such a function is unreachable.
Help: Since the preceding expression never returns, this 'return' statement cannot be reached. You can likely remove the 'return' keyword entirely.
|
|
non-existent-method:
src/SDK/Common/Http/Psr/Client/Discovery/Symfony.php#L32
Method `create` does not exist on type `Symfony\Component\HttpClient\HttpClient`.
>This method selection is invalid
>This expression has type `Symfony\Component\HttpClient\HttpClient`
Help: Ensure the `create` method is defined in the `Symfony\Component\HttpClient\HttpClient` class-like.
|
|
non-existent-class:
src/SDK/Common/Http/Psr/Client/Discovery/Symfony.php#L32
Class `Symfony\Component\HttpClient\Psr18Client` not found.
>`Symfony\Component\HttpClient\Psr18Client` is not defined or cannot be autoloaded
Help: Ensure the name is correct, including its namespace, and that it's properly defined and autoloadable.
|
|
non-existent-class-like:
src/SDK/Common/Http/Psr/Client/Discovery/Symfony.php#L26
Cannot find class, interface, enum, or type alias `Psr\Http\Client\ClientInterface`.
>`Psr\Http\Client\ClientInterface` is not defined in the current codebase
This error occurs when a type is referenced but not found in any analyzed source files or stubs.
If this type comes from an optional dependency or extension, you can safely suppress this issue using `@mago-ignore` or `@mago-expect`.
Help: Verify the type name is spelled correctly, the file containing it is included in analysis, and any required `use` statements are present.
|
|
mixed-return-statement:
src/SDK/Common/Configuration/Configuration.php#L146
Could not infer a precise return type for function `opentelemetry\sdk\common\configuration\configuration::gettype`. Saw type `mixed`.
>Type inferred as `mixed` here.
The analysis could not determine a specific type for the value returned here, resulting in `mixed`. This can happen with complex code paths or unannotated data.
Help: Add specific type hints to variables, parameters, or properties involved in calculating the return value. Consider adding a specific return type declaration to the function signature to catch potential mismatches earlier.
|
|
mixed-return-statement:
src/SDK/Common/Configuration/Configuration.php#L136
Could not infer a precise return type for function `opentelemetry\sdk\common\configuration\configuration::getknownvalues`. Saw type `mixed`.
>Type inferred as `mixed` here.
The analysis could not determine a specific type for the value returned here, resulting in `mixed`. This can happen with complex code paths or unannotated data.
Help: Add specific type hints to variables, parameters, or properties involved in calculating the return value. Consider adding a specific return type declaration to the function signature to catch potential mismatches earlier.
|
|
mixed-argument:
src/SDK/Common/Configuration/Configuration.php#L94
Invalid argument type for argument #1 of `opentelemetry\sdk\common\configuration\parser\listparser::parse`: expected `array<array-key, mixed>|string`, but found `mixed`.
>Argument has type `mixed`
>Arguments to this method are incorrect
The type `mixed` is too general and does not match the expected type `array<array-key, mixed>|string`.
Help: Add specific type hints or assertions to the argument value.
|
|
mixed-argument:
src/SDK/Common/Configuration/Configuration.php#L65
Invalid argument type for argument #2 of `sprintf`: expected `Stringable|null|scalar`, but found `mixed`.
>Argument has type `mixed`
>Arguments to this function are incorrect
The type `mixed` is too general and does not match the expected type `Stringable|null|scalar`.
Help: Add specific type hints or assertions to the argument value.
|
|
mixed-argument:
src/SDK/Common/Configuration/Configuration.php#L63
Invalid argument type for argument #1 of `opentelemetry\sdk\common\configuration\parser\booleanparser::parse`: expected `bool|string`, but found `mixed`.
>Argument has type `mixed`
>Arguments to this method are incorrect
The type `mixed` is too general and does not match the expected type `bool|string`.
Help: Add specific type hints or assertions to the argument value.
|
|
cyclomatic-complexity:
src/SDK/Common/Export/Http/PsrUtils.php#L29
Class has high complexity.
>Class has a cyclomatic complexity of 17, which exceeds the threshold of 15.
|
|
no-empty:
src/Extension/Propagator/CloudTrace/CloudTraceFormatter.php#L31
Use of the `empty` construct.
>Ambiguous check due to `empty()` loose semantic
`empty()` exhibits unexpected behavior on specific value.
It is unclear what condition is being treated with `empty()`.
Help: Use strict comparison or specific predicate function to clearly convey your intent.
|
|
no-error-control-operator:
src/Config/SDK/Configuration/ConfigurationFactory.php#L100
Unsafe use of error control operator `@`.
>This operator suppresses errors
>This expression is being suppressed
Error control operator hide potential errors and make debugging more difficult.
Help: Remove the `@` and use `set_error_handler` to handle errors instead.
|
|
too-many-methods:
src/Contrib/Otlp/HttpEndpointResolver.php#L17
Class has too many methods.
>Class has 13 methods, which exceeds the threshold of 10.
Having a large number of methods can make structures harder to understand and maintain.
Help: Try reducing the number of methods, or consider splitting the structure into smaller, more focused structures.
|
|
kan-defect:
src/Config/SDK/ComponentProvider/OpenTelemetrySdk.php#L61
Class has a high kan defect score.
>Class has a kan defect score of 4.5, which exceeds the threshold of 1.6.
Kan defect is a heuristic used by phpmetrics to estimate defect-proneness based on control-flow statements.
Help: You can also consider splitting large units of code into smaller, more focused units.
|
|
cyclomatic-complexity:
src/Config/SDK/ComponentProvider/OpenTelemetrySdk.php#L61
Class has high complexity.
>Class has a cyclomatic complexity of 55, which exceeds the threshold of 15.
|
|
too-many-methods:
src/SDK/Registry.php#L22
Class has too many methods.
>Class has 15 methods, which exceeds the threshold of 10.
Having a large number of methods can make structures harder to understand and maintain.
Help: Try reducing the number of methods, or consider splitting the structure into smaller, more focused structures.
|
|
cyclomatic-complexity:
src/SDK/Registry.php#L22
Class has high complexity.
>Class has a cyclomatic complexity of 31, which exceeds the threshold of 15.
|
|
excessive-parameter-list:
src/SDK/Metrics/Aggregation/LastValueAggregation.php#L59
Parameter list is too long.
>This list has 6 parameters, which exceeds the threshold of 5.
Having a large number of parameters can make functions harder to understand and maintain.
Help: Try reducing the number of parameters, or consider passing an object or a shape instead.
|
|
too-many-methods:
src/SDK/Common/Configuration/Configuration.php#L23
Class has too many methods.
>Class has 16 methods, which exceeds the threshold of 10.
Having a large number of methods can make structures harder to understand and maintain.
Help: Try reducing the number of methods, or consider splitting the structure into smaller, more focused structures.
|
|
Mago Quality Checks
Process completed with exit code 1.
|
|
mixed-assignment:
src/SDK/Registry.php#L171
Assigning `mixed` type to a variable may lead to unexpected behavior.
>Assigning `mixed` type here.
Using `mixed` can lead to runtime errors if the variable is used in a way that assumes a specific type.
Help: Consider using a more specific type to avoid potential issues.
|
|
mixed-assignment:
src/SDK/Registry.php#L154
Assigning `mixed` type to a variable may lead to unexpected behavior.
>Assigning `mixed` type here.
Using `mixed` can lead to runtime errors if the variable is used in a way that assumes a specific type.
Help: Consider using a more specific type to avoid potential issues.
|
|
mixed-assignment:
src/SDK/Registry.php#L142
Assigning `mixed` type to a variable may lead to unexpected behavior.
>Assigning `mixed` type here.
Using `mixed` can lead to runtime errors if the variable is used in a way that assumes a specific type.
Help: Consider using a more specific type to avoid potential issues.
|
|
redundant-type-comparison:
src/SDK/Registry.php#L108
Redundant type assertion: `$factory` of type `never` is always not `string`.
>Argument `$factory` has type `never`
The assertion expects `$factory` to not be `string`, which is always true.
Help: Consider removing this assertion as it has no effect.
|
|
redundant-type-comparison:
src/SDK/Registry.php#L87
Redundant type assertion: `$factory` of type `never` is always not `string`.
>Argument `$factory` has type `never`
The assertion expects `$factory` to not be `string`, which is always true.
Help: Consider removing this assertion as it has no effect.
|
|
redundant-type-comparison:
src/SDK/Registry.php#L66
Redundant type assertion: `$factory` of type `never` is always not `string`.
>Argument `$factory` has type `never`
The assertion expects `$factory` to not be `string`, which is always true.
Help: Consider removing this assertion as it has no effect.
|
|
redundant-type-comparison:
src/SDK/Registry.php#L45
Redundant type assertion: `$factory` of type `never` is always not `string`.
>Argument `$factory` has type `never`
The assertion expects `$factory` to not be `string`, which is always true.
Help: Consider removing this assertion as it has no effect.
|
|
invalid-type-cast:
src/SDK/Common/Configuration/Configuration.php#L113
Casting `mixed` to `float`.
>This expression has type `mixed`
The float value of `mixed` cannot be determined statically. The result will be a general `float`.
Help: Consider adding type assertions or checks if a more specific float outcome is expected.
|
|
mixed-assignment:
src/SDK/Common/Configuration/Configuration.php#L55
Assigning `mixed` type to a variable may lead to unexpected behavior.
>Assigning `mixed` type here.
Using `mixed` can lead to runtime errors if the variable is used in a way that assumes a specific type.
Help: Consider using a more specific type to avoid potential issues.
|
|
tagged-todo:
src/Config/SDK/ComponentProvider/OpenTelemetrySdk.php#L381
TODO should be tagged with (@username) or (#issue).
>TODO comment is untagged
Help: Add a user tag or issue reference to the TODO comment, e.g. TODO(@azjezz), TODO(azjezz), TODO(#123).
|
|
tagged-todo:
src/Config/SDK/ComponentProvider/OpenTelemetrySdk.php#L332
TODO should be tagged with (@username) or (#issue).
>TODO comment is untagged
Help: Add a user tag or issue reference to the TODO comment, e.g. TODO(@azjezz), TODO(azjezz), TODO(#123).
|
|
tagged-todo:
src/Config/SDK/ComponentProvider/OpenTelemetrySdk.php#L327
TODO should be tagged with (@username) or (#issue).
>TODO comment is untagged
Help: Add a user tag or issue reference to the TODO comment, e.g. TODO(@azjezz), TODO(azjezz), TODO(#123).
|
|
tagged-todo:
src/Config/SDK/ComponentProvider/OpenTelemetrySdk.php#L308
TODO should be tagged with (@username) or (#issue).
>TODO comment is untagged
Help: Add a user tag or issue reference to the TODO comment, e.g. TODO(@azjezz), TODO(azjezz), TODO(#123).
|
|
assert-description:
src/SDK/Metrics/SynchronousInstrumentTrait.php#L21
Missing description in assert function.
>`assert` function is called here
Assert functions should have a description to make it easier to understand the purpose of the assertion.
Help: Add a description to the assert function to clarify its purpose.
|
|
assert-description:
src/SDK/Registry.php#L185
Missing description in assert function.
>`assert` function is called here
Assert functions should have a description to make it easier to understand the purpose of the assertion.
Help: Add a description to the assert function to clarify its purpose.
|
|
assert-description:
src/SDK/Registry.php#L173
Missing description in assert function.
>`assert` function is called here
Assert functions should have a description to make it easier to understand the purpose of the assertion.
Help: Add a description to the assert function to clarify its purpose.
|
|
assert-description:
src/SDK/Registry.php#L156
Missing description in assert function.
>`assert` function is called here
Assert functions should have a description to make it easier to understand the purpose of the assertion.
Help: Add a description to the assert function to clarify its purpose.
|
|
assert-description:
src/SDK/Registry.php#L144
Missing description in assert function.
>`assert` function is called here
Assert functions should have a description to make it easier to understand the purpose of the assertion.
Help: Add a description to the assert function to clarify its purpose.
|
|
no-nested-ternary:
src/SDK/Common/Configuration/Configuration.php#L58
Nested ternary expressions are confusing due to PHP's operator associativity rules.
>This is the nested ternary operation
>It is nested inside this outer ternary operator
The ternary operator `? :` is non-associative in PHP 8+, was left-associative before, and is right-associative in most other languages.
This can lead to unexpected behavior, and even with parentheses, it can be hard to read and understand.
Help: Consider refactoring the logic into a separate `if/else` statement or a `match` expression for clarity.
|
|
no-else-clause:
src/Contrib/Otlp/AttributesConverter.php#L30
Avoid `else` clauses.
>This `else` clause can often be eliminated
Code is often clearer when the main logic is not nested inside an `if` statement.
Help: Consider refactoring to use an early return (a guard clause) to simplify the control flow.
|
|
no-boolean-flag-parameter:
src/SDK/Metrics/ReferenceCounterInterface.php#L12
Avoid boolean flag parameters.
>This parameter acts as a boolean flag
>Boolean type declared here
Boolean flags often indicate a function has more than one responsibility, making it harder to understand and test.
Help: Refactor by splitting the function into two separate methods, each with a clear, descriptive name.
|
|
no-boolean-flag-parameter:
src/Config/SDK/Configuration/ConfigurationFactory.php#L90
Avoid boolean flag parameters.
>This parameter acts as a boolean flag
>Boolean type declared here
Boolean flags often indicate a function has more than one responsibility, making it harder to understand and test.
Help: Refactor by splitting the function into two separate methods, each with a clear, descriptive name.
|
|
no-boolean-flag-parameter:
src/SDK/Registry.php#L129
Avoid boolean flag parameters.
>This parameter acts as a boolean flag
>Boolean type declared here
Boolean flags often indicate a function has more than one responsibility, making it harder to understand and test.
Help: Refactor by splitting the function into two separate methods, each with a clear, descriptive name.
|
|
no-boolean-flag-parameter:
src/SDK/Registry.php#L116
Avoid boolean flag parameters.
>This parameter acts as a boolean flag
>Boolean type declared here
Boolean flags often indicate a function has more than one responsibility, making it harder to understand and test.
Help: Refactor by splitting the function into two separate methods, each with a clear, descriptive name.
|
|
no-boolean-flag-parameter:
src/SDK/Registry.php#L99
Avoid boolean flag parameters.
>This parameter acts as a boolean flag
>Boolean type declared here
Boolean flags often indicate a function has more than one responsibility, making it harder to understand and test.
Help: Refactor by splitting the function into two separate methods, each with a clear, descriptive name.
|
|
no-boolean-flag-parameter:
src/SDK/Registry.php#L78
Avoid boolean flag parameters.
>This parameter acts as a boolean flag
>Boolean type declared here
Boolean flags often indicate a function has more than one responsibility, making it harder to understand and test.
Help: Refactor by splitting the function into two separate methods, each with a clear, descriptive name.
|
|
no-boolean-flag-parameter:
src/SDK/Registry.php#L57
Avoid boolean flag parameters.
>This parameter acts as a boolean flag
>Boolean type declared here
Boolean flags often indicate a function has more than one responsibility, making it harder to understand and test.
Help: Refactor by splitting the function into two separate methods, each with a clear, descriptive name.
|
|
no-boolean-flag-parameter:
src/SDK/Registry.php#L36
Avoid boolean flag parameters.
>This parameter acts as a boolean flag
>Boolean type declared here
Boolean flags often indicate a function has more than one responsibility, making it harder to understand and test.
Help: Refactor by splitting the function into two separate methods, each with a clear, descriptive name.
|
|
no-boolean-flag-parameter:
src/API/Metrics/Noop/NoopObservableGauge.php#L16
Avoid boolean flag parameters.
>This parameter acts as a boolean flag
>Boolean type declared here
Boolean flags often indicate a function has more than one responsibility, making it harder to understand and test.
Help: Refactor by splitting the function into two separate methods, each with a clear, descriptive name.
|