1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-15 10:57:08 +01:00
psalm/docs/running_psalm/error_levels.md

320 lines
16 KiB
Markdown
Raw Normal View History

2020-02-17 22:33:28 +01:00
# Error levels
You can run Psalm in at different levels of strictness from 1 to 8.
Level 1 is the most strict, level 8 is the most lenient.
When no level is explicitly defined, psalm defaults to level 2.
2020-02-17 22:33:28 +01:00
Some issues are [always treated as errors](#always-treated-as-errors). These are issues with a very low probability of false-positives.
At [level 1](#errors-that-only-appear-at-level-1) all issues (except those emitted for opt-in features) that Psalm can find are treated as errors. Those issues include any situation where Psalm cannot infer the type of a given expression.
At level 2 Psalm ignores those `Mixed*` issues, but treats most other issues as errors.
At level 3 Psalm starts to be a little more lenient. For example Psalm allows missing param types, return types and property types.
At level 4 Psalm ignores issues for _possible_ problems. These are more likely to be false positives where the application code may guarantee behaviour that Psalm isn't able to infer.
Level 5 and above allows a more non-verifiable code, and higher levels are even more permissive.
## Always treated as errors
2020-03-19 17:34:48 +01:00
- [AbstractMethodCall](issues/AbstractMethodCall.md)
2020-11-30 05:21:09 +01:00
- [ComplexFunction](issues/ComplexFunction.md)
- [ComplexMethod](issues/ComplexMethod.md)
- [ConfigIssue](issues/ConfigIssue.md)
2020-03-19 17:34:48 +01:00
- [DuplicateArrayKey](issues/DuplicateArrayKey.md)
- [DuplicateClass](issues/DuplicateClass.md)
- [DuplicateFunction](issues/DuplicateFunction.md)
- [DuplicateMethod](issues/DuplicateMethod.md)
- [DuplicateParam](issues/DuplicateParam.md)
- [EmptyArrayAccess](issues/EmptyArrayAccess.md)
2020-11-30 05:21:09 +01:00
- [ExtensionRequirementViolation](issues/ExtensionRequirementViolation.md)
- [ImplementationRequirementViolation](issues/ImplementationRequirementViolation.md)
2020-03-19 17:34:48 +01:00
- [ImpureByReferenceAssignment](issues/ImpureByReferenceAssignment.md)
- [ImpureFunctionCall](issues/ImpureFunctionCall.md)
- [ImpureMethodCall](issues/ImpureMethodCall.md)
- [ImpurePropertyAssignment](issues/ImpurePropertyAssignment.md)
2020-11-30 05:21:09 +01:00
- [ImpurePropertyFetch](issues/ImpurePropertyFetch.md)
2020-03-19 17:34:48 +01:00
- [ImpureStaticProperty](issues/ImpureStaticProperty.md)
- [ImpureStaticVariable](issues/ImpureStaticVariable.md)
2020-11-30 05:21:09 +01:00
- [ImpureVariable](issues/ImpureVariable.md)
2020-03-19 17:34:48 +01:00
- [InaccessibleClassConstant](issues/InaccessibleClassConstant.md)
- [InaccessibleMethod](issues/InaccessibleMethod.md)
- [InaccessibleProperty](issues/InaccessibleProperty.md)
- [InterfaceInstantiation](issues/InterfaceInstantiation.md)
2020-11-30 05:21:09 +01:00
- [InvalidAttribute](issues/InvalidAttribute.md)
- [InvalidExtendClass](issues/InvalidExtendClass.md)
2020-03-19 17:34:48 +01:00
- [InvalidGlobal](issues/InvalidGlobal.md)
- [InvalidParamDefault](issues/InvalidParamDefault.md)
- [InvalidParent](issues/InvalidParent.md)
- [InvalidPassByReference](issues/InvalidPassByReference.md)
- [InvalidScope](issues/InvalidScope.md)
- [InvalidStaticInvocation](issues/InvalidStaticInvocation.md)
- [InvalidThrow](issues/InvalidThrow.md)
- [LoopInvalidation](issues/LoopInvalidation.md)
- [MethodSignatureMustOmitReturnType](issues/MethodSignatureMustOmitReturnType.md)
2022-01-19 12:20:50 +01:00
- [MethodSignatureMustProvideReturnType](issues/MethodSignatureMustProvideReturnType.md)
2020-03-19 17:34:48 +01:00
- [MissingDependency](issues/MissingDependency.md)
- [MissingFile](issues/MissingFile.md)
- [MissingImmutableAnnotation](issues/MissingImmutableAnnotation.md)
- [MissingTemplateParam](issues/MissingTemplateParam.md)
- [MissingThrowsDocblock](issues/MissingThrowsDocblock.md)
- [NonStaticSelfCall](issues/NonStaticSelfCall.md)
2020-11-30 05:21:09 +01:00
- [NoValue](issues/NoValue.md)
2020-03-19 17:34:48 +01:00
- [NullArrayAccess](issues/NullArrayAccess.md)
- [NullFunctionCall](issues/NullFunctionCall.md)
- [NullIterator](issues/NullIterator.md)
- [NullPropertyAssignment](issues/NullPropertyAssignment.md)
- [NullPropertyFetch](issues/NullPropertyFetch.md)
- [NullReference](issues/NullReference.md)
- [OverriddenPropertyAccess](issues/OverriddenPropertyAccess.md)
- [ParadoxicalCondition](issues/ParadoxicalCondition.md)
- [ParentNotFound](issues/ParentNotFound.md)
- [TooFewArguments](issues/TooFewArguments.md)
2020-11-30 05:21:09 +01:00
- [UndefinedAttributeClass](issues/UndefinedAttributeClass.md)
2020-03-19 17:34:48 +01:00
- [UndefinedClass](issues/UndefinedClass.md)
- [UndefinedConstant](issues/UndefinedConstant.md)
- [UndefinedDocblockClass](issues/UndefinedDocblockClass.md)
- [UndefinedFunction](issues/UndefinedFunction.md)
- [UndefinedGlobalVariable](issues/UndefinedGlobalVariable.md)
- [UndefinedInterface](issues/UndefinedInterface.md)
- [UndefinedTrait](issues/UndefinedTrait.md)
- [UndefinedVariable](issues/UndefinedVariable.md)
- [UnimplementedAbstractMethod](issues/UnimplementedAbstractMethod.md)
- [UnimplementedInterfaceMethod](issues/UnimplementedInterfaceMethod.md)
- [UnrecognizedExpression](issues/UnrecognizedExpression.md)
- [UnrecognizedStatement](issues/UnrecognizedStatement.md)
- [UnusedFunctionCall](issues/UnusedFunctionCall.md)
- [UnusedMethodCall](issues/UnusedMethodCall.md)
2020-02-17 22:33:28 +01:00
## Errors that only appear at level 1
2020-03-19 17:34:48 +01:00
- [LessSpecificReturnType](issues/LessSpecificReturnType.md)
- [MixedArgument](issues/MixedArgument.md)
- [MixedArgumentTypeCoercion](issues/MixedArgumentTypeCoercion.md)
- [MixedArrayAccess](issues/MixedArrayAccess.md)
- [MixedArrayAssignment](issues/MixedArrayAssignment.md)
- [MixedArrayOffset](issues/MixedArrayOffset.md)
- [MixedArrayTypeCoercion](issues/MixedArrayTypeCoercion.md)
- [MixedAssignment](issues/MixedAssignment.md)
- [MixedClone](issues/MixedClone.md)
2020-03-19 17:34:48 +01:00
- [MixedFunctionCall](issues/MixedFunctionCall.md)
- [MixedInferredReturnType](issues/MixedInferredReturnType.md)
- [MixedMethodCall](issues/MixedMethodCall.md)
- [MixedOperand](issues/MixedOperand.md)
- [MixedPropertyAssignment](issues/MixedPropertyAssignment.md)
- [MixedPropertyFetch](issues/MixedPropertyFetch.md)
- [MixedPropertyTypeCoercion](issues/MixedPropertyTypeCoercion.md)
- [MixedReturnStatement](issues/MixedReturnStatement.md)
- [MixedReturnTypeCoercion](issues/MixedReturnTypeCoercion.md)
- [MixedStringOffsetAssignment](issues/MixedStringOffsetAssignment.md)
- [MutableDependency](issues/MutableDependency.md)
- [PossiblyNullOperand](issues/PossiblyNullOperand.md)
- [RedundantIdentityWithTrue](issues/RedundantIdentityWithTrue.md)
- [Trace](issues/Trace.md)
2020-02-17 22:33:28 +01:00
## Errors ignored at level 3 and higher
These issues are treated as errors at level 2 and below.
2020-03-19 17:34:48 +01:00
- [DeprecatedClass](issues/DeprecatedClass.md)
- [DeprecatedConstant](issues/DeprecatedConstant.md)
- [DeprecatedFunction](issues/DeprecatedFunction.md)
- [DeprecatedInterface](issues/DeprecatedInterface.md)
- [DeprecatedMethod](issues/DeprecatedMethod.md)
- [DeprecatedProperty](issues/DeprecatedProperty.md)
- [DeprecatedTrait](issues/DeprecatedTrait.md)
- [DocblockTypeContradiction](issues/DocblockTypeContradiction.md)
- [InvalidDocblockParamName](issues/InvalidDocblockParamName.md)
- [InvalidFalsableReturnType](issues/InvalidFalsableReturnType.md)
- [InvalidStringClass](issues/InvalidStringClass.md)
- [MissingClosureParamType](issues/MissingClosureParamType.md)
- [MissingClosureReturnType](issues/MissingClosureReturnType.md)
- [MissingConstructor](issues/MissingConstructor.md)
- [MissingParamType](issues/MissingParamType.md)
- [MissingPropertyType](issues/MissingPropertyType.md)
- [MissingReturnType](issues/MissingReturnType.md)
- [NullOperand](issues/NullOperand.md)
- [PropertyNotSetInConstructor](issues/PropertyNotSetInConstructor.md)
- [RawObjectIteration](issues/RawObjectIteration.md)
- [RedundantConditionGivenDocblockType](issues/RedundantConditionGivenDocblockType.md)
2021-12-30 11:56:02 +01:00
- [RedundantFunctionCallGivenDocblockType](issues/RedundantFunctionCallGivenDocblockType.md)
2020-03-19 17:34:48 +01:00
- [ReferenceConstraintViolation](issues/ReferenceConstraintViolation.md)
2020-11-30 05:21:09 +01:00
- [UndefinedTrace](issues/UndefinedTrace.md)
2020-03-19 17:34:48 +01:00
- [UnresolvableInclude](issues/UnresolvableInclude.md)
- [UnsafeInstantiation](issues/UnsafeInstantiation.md)
2020-02-17 22:33:28 +01:00
## Errors ignored at level 4 and higher
These issues are treated as errors at level 3 and below.
2020-03-19 17:34:48 +01:00
- [ArgumentTypeCoercion](issues/ArgumentTypeCoercion.md)
- [LessSpecificReturnStatement](issues/LessSpecificReturnStatement.md)
- [MoreSpecificReturnType](issues/MoreSpecificReturnType.md)
- [PossiblyFalseArgument](issues/PossiblyFalseArgument.md)
- [PossiblyFalseIterator](issues/PossiblyFalseIterator.md)
- [PossiblyFalseOperand](issues/PossiblyFalseOperand.md)
- [PossiblyFalsePropertyAssignmentValue](issues/PossiblyFalsePropertyAssignmentValue.md)
- [PossiblyFalseReference](issues/PossiblyFalseReference.md)
- [PossiblyInvalidArgument](issues/PossiblyInvalidArgument.md)
- [PossiblyInvalidArrayAccess](issues/PossiblyInvalidArrayAccess.md)
- [PossiblyInvalidArrayAssignment](issues/PossiblyInvalidArrayAssignment.md)
- [PossiblyInvalidArrayOffset](issues/PossiblyInvalidArrayOffset.md)
- [PossiblyInvalidCast](issues/PossiblyInvalidCast.md)
- [PossiblyInvalidClone](issues/PossiblyInvalidClone.md)
2020-03-19 17:34:48 +01:00
- [PossiblyInvalidFunctionCall](issues/PossiblyInvalidFunctionCall.md)
- [PossiblyInvalidIterator](issues/PossiblyInvalidIterator.md)
- [PossiblyInvalidMethodCall](issues/PossiblyInvalidMethodCall.md)
- [PossiblyInvalidOperand](issues/PossiblyInvalidOperand.md)
- [PossiblyInvalidPropertyAssignment](issues/PossiblyInvalidPropertyAssignment.md)
- [PossiblyInvalidPropertyAssignmentValue](issues/PossiblyInvalidPropertyAssignmentValue.md)
- [PossiblyInvalidPropertyFetch](issues/PossiblyInvalidPropertyFetch.md)
- [PossiblyNullArgument](issues/PossiblyNullArgument.md)
- [PossiblyNullArrayAccess](issues/PossiblyNullArrayAccess.md)
- [PossiblyNullArrayAssignment](issues/PossiblyNullArrayAssignment.md)
- [PossiblyNullArrayOffset](issues/PossiblyNullArrayOffset.md)
- [PossiblyNullFunctionCall](issues/PossiblyNullFunctionCall.md)
- [PossiblyNullIterator](issues/PossiblyNullIterator.md)
- [PossiblyNullPropertyAssignment](issues/PossiblyNullPropertyAssignment.md)
- [PossiblyNullPropertyAssignmentValue](issues/PossiblyNullPropertyAssignmentValue.md)
- [PossiblyNullPropertyFetch](issues/PossiblyNullPropertyFetch.md)
- [PossiblyNullReference](issues/PossiblyNullReference.md)
- [PossiblyUndefinedArrayOffset](issues/PossiblyUndefinedArrayOffset.md)
- [PossiblyUndefinedGlobalVariable](issues/PossiblyUndefinedGlobalVariable.md)
- [PossiblyUndefinedMethod](issues/PossiblyUndefinedMethod.md)
- [PossiblyUndefinedVariable](issues/PossiblyUndefinedVariable.md)
- [PropertyTypeCoercion](issues/PropertyTypeCoercion.md)
2020-02-17 22:33:28 +01:00
## Errors ignored at level 5 and higher
These issues are treated as errors at level 4 and below.
2020-03-19 17:34:48 +01:00
- [FalseOperand](issues/FalseOperand.md)
- [ForbiddenCode](issues/ForbiddenCode.md)
- [ImplementedParamTypeMismatch](issues/ImplementedParamTypeMismatch.md)
- [ImplementedReturnTypeMismatch](issues/ImplementedReturnTypeMismatch.md)
- [ImplicitToStringCast](issues/ImplicitToStringCast.md)
- [InternalClass](issues/InternalClass.md)
- [InternalMethod](issues/InternalMethod.md)
- [InternalProperty](issues/InternalProperty.md)
- [InvalidDocblock](issues/InvalidDocblock.md)
- [InvalidLiteralArgument](issues/InvalidLiteralArgument.md)
2020-03-19 17:34:48 +01:00
- [InvalidOperand](issues/InvalidOperand.md)
- [InvalidScalarArgument](issues/InvalidScalarArgument.md)
- [InvalidToString](issues/InvalidToString.md)
- [MismatchingDocblockParamType](issues/MismatchingDocblockParamType.md)
- [MismatchingDocblockReturnType](issues/MismatchingDocblockReturnType.md)
- [MissingDocblockType](issues/MissingDocblockType.md)
- [NoInterfaceProperties](issues/NoInterfaceProperties.md)
- [PossibleRawObjectIteration](issues/PossibleRawObjectIteration.md)
- [RedundantCondition](issues/RedundantCondition.md)
2021-12-30 11:56:02 +01:00
- [RedundantFunctionCall](issues/RedundantFunctionCall.md)
- [RedundantPropertyInitializationCheck](issues/RedundantPropertyInitializationCheck.md)
2020-03-19 17:34:48 +01:00
- [StringIncrement](issues/StringIncrement.md)
- [TooManyArguments](issues/TooManyArguments.md)
- [TypeDoesNotContainNull](issues/TypeDoesNotContainNull.md)
- [TypeDoesNotContainType](issues/TypeDoesNotContainType.md)
- [UndefinedMagicMethod](issues/UndefinedMagicMethod.md)
- [UndefinedMagicPropertyAssignment](issues/UndefinedMagicPropertyAssignment.md)
- [UndefinedMagicPropertyFetch](issues/UndefinedMagicPropertyFetch.md)
2020-02-17 22:33:28 +01:00
## Errors ignored at level 6 and higher
These issues are treated as errors at level 5 and below.
- [ConstructorSignatureMismatch](issues/ConstructorSignatureMismatch.md)
2020-03-19 17:34:48 +01:00
- [FalsableReturnStatement](issues/FalsableReturnStatement.md)
- [InvalidNullableReturnType](issues/InvalidNullableReturnType.md)
- [LessSpecificImplementedReturnType](issues/LessSpecificImplementedReturnType.md)
- [MoreSpecificImplementedParamType](issues/MoreSpecificImplementedParamType.md)
- [NullableReturnStatement](issues/NullableReturnStatement.md)
- [UndefinedInterfaceMethod](issues/UndefinedInterfaceMethod.md)
- [UndefinedThisPropertyAssignment](issues/UndefinedThisPropertyAssignment.md)
2020-02-17 22:33:28 +01:00
## Errors ignored at level 7 and higher
These issues are treated as errors at level 6 and below.
2020-03-19 17:34:48 +01:00
- [InvalidArgument](issues/InvalidArgument.md)
- [InvalidArrayAccess](issues/InvalidArrayAccess.md)
- [InvalidArrayAssignment](issues/InvalidArrayAssignment.md)
- [InvalidArrayOffset](issues/InvalidArrayOffset.md)
- [InvalidCast](issues/InvalidCast.md)
- [InvalidCatch](issues/InvalidCatch.md)
- [InvalidClass](issues/InvalidClass.md)
- [InvalidClone](issues/InvalidClone.md)
- [InvalidFunctionCall](issues/InvalidFunctionCall.md)
- [InvalidIterator](issues/InvalidIterator.md)
- [InvalidMethodCall](issues/InvalidMethodCall.md)
2020-11-30 05:21:09 +01:00
- [InvalidNamedArgument](issues/InvalidNamedArgument.md)
2020-03-19 17:34:48 +01:00
- [InvalidPropertyAssignment](issues/InvalidPropertyAssignment.md)
- [InvalidPropertyAssignmentValue](issues/InvalidPropertyAssignmentValue.md)
- [InvalidPropertyFetch](issues/InvalidPropertyFetch.md)
- [InvalidReturnStatement](issues/InvalidReturnStatement.md)
- [InvalidReturnType](issues/InvalidReturnType.md)
- [InvalidTemplateParam](issues/InvalidTemplateParam.md)
- [NullArgument](issues/NullArgument.md)
- [NullArrayOffset](issues/NullArrayOffset.md)
- [TooManyTemplateParams](issues/TooManyTemplateParams.md)
- [TraitMethodSignatureMismatch](issues/TraitMethodSignatureMismatch.md)
- [UndefinedMethod](issues/UndefinedMethod.md)
- [UndefinedPropertyAssignment](issues/UndefinedPropertyAssignment.md)
- [UndefinedPropertyFetch](issues/UndefinedPropertyFetch.md)
- [UndefinedThisPropertyFetch](issues/UndefinedThisPropertyFetch.md)
2020-02-17 22:33:28 +01:00
## Errors ignored at level 8
These issues are treated as errors at level 7 and below.
2020-03-19 17:34:48 +01:00
- [AbstractInstantiation](issues/AbstractInstantiation.md)
- [AssignmentToVoid](issues/AssignmentToVoid.md)
- [CircularReference](issues/CircularReference.md)
- [ConflictingReferenceConstraint](issues/ConflictingReferenceConstraint.md)
- [ContinueOutsideLoop](issues/ContinueOutsideLoop.md)
2020-11-30 05:21:09 +01:00
- [InvalidTypeImport](issues/InvalidTypeImport.md)
2020-03-19 17:34:48 +01:00
- [MethodSignatureMismatch](issues/MethodSignatureMismatch.md)
- [OverriddenMethodAccess](issues/OverriddenMethodAccess.md)
- [ParamNameMismatch](issues/ParamNameMismatch.md)
2020-03-19 17:34:48 +01:00
- [ReservedWord](issues/ReservedWord.md)
- [UnhandledMatchCondition](issues/UnhandledMatchCondition.md)
2020-11-30 05:21:09 +01:00
- [UninitializedProperty](issues/UninitializedProperty.md)
2020-02-17 22:33:28 +01:00
## Feature-specific errors
2020-03-19 17:34:48 +01:00
- [PossiblyUndefinedIntArrayOffset](issues/PossiblyUndefinedIntArrayOffset.md)
- [PossiblyUndefinedStringArrayOffset](issues/PossiblyUndefinedStringArrayOffset.md)
- [PossiblyUnusedMethod](issues/PossiblyUnusedMethod.md)
- [PossiblyUnusedParam](issues/PossiblyUnusedParam.md)
- [PossiblyUnusedProperty](issues/PossiblyUnusedProperty.md)
2020-11-30 05:21:09 +01:00
- [TaintedCallable](issues/TaintedCallable.md)
- [TaintedCookie](issues/TaintedCookie.md)
- [TaintedCustom](issues/TaintedCustom.md)
- [TaintedEval](issues/TaintedEval.md)
- [TaintedFile](issues/TaintedFile.md)
- [TaintedHeader](issues/TaintedHeader.md)
- [TaintedHtml](issues/TaintedHtml.md)
- [TaintedInclude](issues/TaintedInclude.md)
2020-03-19 17:34:48 +01:00
- [TaintedInput](issues/TaintedInput.md)
2020-11-30 05:21:09 +01:00
- [TaintedLdap](issues/TaintedLdap.md)
- [TaintedShell](issues/TaintedShell.md)
- [TaintedSql](issues/TaintedSql.md)
- [TaintedSSRF](issues/TaintedSSRF.md)
- [TaintedSystemSecret](issues/TaintedSystemSecret.md)
- [TaintedUnserialize](issues/TaintedUnserialize.md)
- [TaintedUserSecret](issues/TaintedUserSecret.md)
2020-03-19 17:34:48 +01:00
- [UncaughtThrowInGlobalScope](issues/UncaughtThrowInGlobalScope.md)
- [UnevaluatedCode](issues/UnevaluatedCode.md)
- [UnnecessaryVarAnnotation](issues/UnnecessaryVarAnnotation.md)
- [UnusedClass](issues/UnusedClass.md)
- [UnusedClosureParam](issues/UnusedClosureParam.md)
2020-11-30 05:21:09 +01:00
- [UnusedConstructor](issues/UnusedConstructor.md)
- [UnusedForeachValue](issues/UnusedForeachValue.md)
2020-03-19 17:34:48 +01:00
- [UnusedMethod](issues/UnusedMethod.md)
- [UnusedParam](issues/UnusedParam.md)
- [UnusedProperty](issues/UnusedProperty.md)
- [UnusedPsalmSuppress](issues/UnusedPsalmSuppress.md)
- [UnusedVariable](issues/UnusedVariable.md)