Fix CI: suppress RepeatedField psalm errors, restore PHP 8.1 support #1965
+7
−2
Annotations
21 errors, 19 warnings, and 10 notices
|
Static Analysis:
src/SDK/Logs/PsrSeverityMapperInterface.php#L42
Class, interface, enum, or trait `Psr\Log\LogLevel` not found.
>`Psr\Log\LogLevel` is not defined or cannot be found
Help: Ensure the name is correct, including its namespace, and that it's properly defined and autoloadable.
|
|
Static Analysis:
src/SDK/Logs/PsrSeverityMapperInterface.php#L41
Class, interface, enum, or trait `Psr\Log\LogLevel` not found.
>`Psr\Log\LogLevel` is not defined or cannot be found
Help: Ensure the name is correct, including its namespace, and that it's properly defined and autoloadable.
|
|
Static Analysis:
src/SDK/Logs/PsrSeverityMapperInterface.php#L33
Class, interface, enum, or trait `Psr\Log\LogLevel` not found.
>`Psr\Log\LogLevel` is not defined or cannot be found
Help: Ensure the name is correct, including its namespace, and that it's properly defined and autoloadable.
|
|
Static Analysis:
src/SDK/Logs/PsrSeverityMapperInterface.php#L31
Class, interface, enum, or trait `Psr\Log\LogLevel` not found.
>`Psr\Log\LogLevel` is not defined or cannot be found
Help: Ensure the name is correct, including its namespace, and that it's properly defined and autoloadable.
|
|
Static Analysis:
src/SDK/Logs/PsrSeverityMapperInterface.php#L28
Class, interface, enum, or trait `Psr\Log\LogLevel` not found.
>`Psr\Log\LogLevel` is not defined or cannot be found
Help: Ensure the name is correct, including its namespace, and that it's properly defined and autoloadable.
|
|
Static Analysis:
src/SDK/Logs/PsrSeverityMapperInterface.php#L26
Class, interface, enum, or trait `Psr\Log\LogLevel` not found.
>`Psr\Log\LogLevel` is not defined or cannot be found
Help: Ensure the name is correct, including its namespace, and that it's properly defined and autoloadable.
|
|
Static Analysis:
src/SDK/Logs/PsrSeverityMapperInterface.php#L24
Class, interface, enum, or trait `Psr\Log\LogLevel` not found.
>`Psr\Log\LogLevel` is not defined or cannot be found
Help: Ensure the name is correct, including its namespace, and that it's properly defined and autoloadable.
|
|
Static Analysis:
src/SDK/Logs/PsrSeverityMapperInterface.php#L21
Class, interface, enum, or trait `Psr\Log\LogLevel` not found.
>`Psr\Log\LogLevel` is not defined or cannot be found
Help: Ensure the name is correct, including its namespace, and that it's properly defined and autoloadable.
|
|
Static Analysis:
src/SDK/Logs/PsrSeverityMapperInterface.php#L19
Class, interface, enum, or trait `Psr\Log\LogLevel` not found.
>`Psr\Log\LogLevel` is not defined or cannot be found
Help: Ensure the name is correct, including its namespace, and that it's properly defined and autoloadable.
|
|
Static Analysis:
src/SDK/Logs/PsrSeverityMapperInterface.php#L17
Class, interface, enum, or trait `Psr\Log\LogLevel` not found.
>`Psr\Log\LogLevel` is not defined or cannot be found
Help: Ensure the name is correct, including its namespace, and that it's properly defined and autoloadable.
|
|
Linting:
src/Config/SDK/Configuration/Internal/Substitution.php#L24
Class has high complexity.
>Class has a cyclomatic complexity of 28, which exceeds the threshold of 15.
|
|
Linting:
src/SDK/Logs/EventLogger.php#L34
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.
|
|
Linting:
src/API/Logs/NoopLogRecordBuilder.php#L13
Class has too many methods.
>Class has 11 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.
|
|
Linting:
src/API/Logs/EventLoggerInterface.php#L15
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.
|
|
Linting:
src/SDK/Logs/Processor/BatchLogRecordProcessor.php#L56
Parameter list is too long.
>This list has 8 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.
|
|
Linting:
src/SDK/Logs/Processor/BatchLogRecordProcessor.php#L21
Class has too many properties.
>Class has 14 properties, which exceeds the threshold of 10.
Having a large number of properties can make classes harder to understand and maintain.
Help: Try reducing the number of properties, or consider grouping related properties into a single object.
|
|
Linting:
src/SDK/Logs/Processor/BatchLogRecordProcessor.php#L21
Class has a high kan defect score.
>Class has a kan defect score of 1.71, 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.
|
|
Linting:
src/SDK/Logs/Processor/BatchLogRecordProcessor.php#L21
Class has high complexity.
>Class has a cyclomatic complexity of 29, which exceeds the threshold of 15.
|
|
Linting:
src/Config/SDK/ComponentProvider/OpenTelemetrySdk.php#L64
Class has a high kan defect score.
>Class has a kan defect score of 4.73, 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.
|
|
Linting:
src/Config/SDK/ComponentProvider/OpenTelemetrySdk.php#L64
Class has high complexity.
>Class has a cyclomatic complexity of 57, which exceeds the threshold of 15.
|
|
Formatting
Process completed with exit code 1.
|
|
Static Analysis:
src/Config/SDK/ComponentProvider/OpenTelemetrySdk.php#L687
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.
|
|
Static Analysis:
src/Config/SDK/ComponentProvider/OpenTelemetrySdk.php#L681
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.
|
|
Static Analysis:
src/Config/SDK/ComponentProvider/OpenTelemetrySdk.php#L637
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.
|
|
Static Analysis:
src/Config/SDK/ComponentProvider/OpenTelemetrySdk.php#L546
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.
|
|
Static Analysis:
src/Config/SDK/ComponentProvider/OpenTelemetrySdk.php#L497
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.
|
|
Static Analysis:
src/Config/SDK/ComponentProvider/OpenTelemetrySdk.php#L484
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.
|
|
Static Analysis:
src/Config/SDK/ComponentProvider/OpenTelemetrySdk.php#L442
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.
|
|
Static Analysis:
src/Config/SDK/ComponentProvider/OpenTelemetrySdk.php#L415
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.
|
|
Static Analysis:
src/Config/SDK/ComponentProvider/OpenTelemetrySdk.php#L407
Call to deprecated method: `OpenTelemetry\SDK\SdkBuilder::setEventLoggerProvider`.
>This method is deprecated
The method `OpenTelemetry\SDK\SdkBuilder::setEventLoggerProvider` is marked as deprecated and may be removed or its behavior changed in future versions.
Help: Consult the documentation for `OpenTelemetry\SDK\SdkBuilder::setEventLoggerProvider` for alternatives or migration instructions.
|
|
Linting:
src/Config/SDK/ComponentProvider/OpenTelemetrySdk.php#L325
Use of the `isset` construct.
>Ambiguous check due to `isset()` conflating existence and null comparison
`isset()` returns false for both unset variables and null values.
It is unclear whether you're checking for variable existence or non-null value.
Help: Use explicit null comparison (`!== null`) or the null coalescing operator (`??`).
|
|
Linting:
src/Config/SDK/ComponentProvider/OpenTelemetrySdk.php#L322
Use of the `isset` construct.
>Ambiguous check due to `isset()` conflating existence and null comparison
`isset()` returns false for both unset variables and null values.
It is unclear whether you're checking for variable existence or non-null value.
Help: Use explicit null comparison (`!== null`) or the null coalescing operator (`??`).
|
|
Linting:
src/Config/SDK/ComponentProvider/OpenTelemetrySdk.php#L319
Use of the `isset` construct.
>Ambiguous check due to `isset()` conflating existence and null comparison
`isset()` returns false for both unset variables and null values.
It is unclear whether you're checking for variable existence or non-null value.
Help: Use explicit null comparison (`!== null`) or the null coalescing operator (`??`).
|
|
Linting:
src/Config/SDK/ComponentProvider/OpenTelemetrySdk.php#L316
Use of the `isset` construct.
>Ambiguous check due to `isset()` conflating existence and null comparison
`isset()` returns false for both unset variables and null values.
It is unclear whether you're checking for variable existence or non-null value.
Help: Use explicit null comparison (`!== null`) or the null coalescing operator (`??`).
|
|
Linting:
src/Config/SDK/ComponentProvider/OpenTelemetrySdk.php#L306
Use of the `isset` construct.
>Ambiguous check due to `isset()` conflating existence and null comparison
`isset()` returns false for both unset variables and null values.
It is unclear whether you're checking for variable existence or non-null value.
Help: Use explicit null comparison (`!== null`) or the null coalescing operator (`??`).
|
|
Linting:
src/Config/SDK/ComponentProvider/OpenTelemetrySdk.php#L178
Method has a high halstead volume and effort
>Method exceeds halstead volume and effort threshold(s)
Halstead volume is 3022.5 (threshold 1000). Volume estimates the code's overall size/complexity.
Halstead effort is 24114.28 (threshold 5000). Effort estimates the mental effort required to develop/maintain the code.
Help: Consider breaking this into smaller, more focused functions.
|
|
Linting:
src/Config/SDK/ComponentProvider/OpenTelemetrySdk.php#L393
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).
|
|
Linting:
src/Config/SDK/ComponentProvider/OpenTelemetrySdk.php#L344
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).
|
|
Linting:
src/Config/SDK/ComponentProvider/OpenTelemetrySdk.php#L339
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).
|
|
Linting:
src/Config/SDK/ComponentProvider/OpenTelemetrySdk.php#L320
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).
|
|
Linting:
src/SDK/Metrics/Stream/DeltaStorage.php#L83
Loop body is empty.
>This loop body is empty and performs no actions
Empty loops are often a sign of a logic error or dead code.
Help: Consider removing this loop or adding meaningful logic to its body.
|
|
Linting:
src/SDK/Metrics/Stream/DeltaStorage.php#L46
Consider using early continue pattern to reduce nesting.
>This if statement wraps the entire loop body
>The loop can benefit from early continue to improve readability
This pattern improves readability by reducing nesting levels.
Help: Invert the condition and use `continue` to exit early, then place the main logic outside the if block.
|
|
Linting:
src/SDK/Metrics/Stream/DeltaStorage.php#L42
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.
|
|
Linting:
src/SDK/Metrics/Stream/DeltaStorage.php#L36
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.
|
|
Linting:
src/Config/SDK/Configuration/Internal/Substitution.php#L73
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.
|
|
Linting:
src/SDK/Trace/SpanProcessor/MultiSpanProcessor.php#L55
Consider using early continue pattern to reduce nesting.
>This if statement wraps the entire loop body
>The loop can benefit from early continue to improve readability
This pattern improves readability by reducing nesting levels.
Help: Invert the condition and use `continue` to exit early, then place the main logic outside the if block.
|
|
Linting:
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.
|
|
Linting:
src/SDK/Logs/Processor/BatchLogRecordProcessor.php#L213
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.
|
|
Linting:
src/SDK/Logs/Processor/BatchLogRecordProcessor.php#L200
Use `while` loop instead of `for` loop.
>This `for` loop can be simplified to a `while` loop
This `for` loop can be simplified to a `while` loop since it doesn't have initializations or increments.
Help: Use a `while` loop instead of a `for` loop.
|
|
Linting:
src/SDK/Metrics/MetricExporter/InMemoryExporter.php#L42
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.
|
background
wait
wait-all
cancel
Loading