diff --git a/.gitignore b/.gitignore index 535cccc51e..6422f6d155 100644 --- a/.gitignore +++ b/.gitignore @@ -184,5 +184,8 @@ CodeGraphData/ /Rubberduck.Deployment/Rubberduck.API.idl /Rubberduck.Deployment/Rubberduck.idl +# Generated Artifacts +Rubberduck.CodeAnalysis.xml + #Gradle /.gradle/ diff --git a/Rubberduck.CodeAnalysis/Inspections/Concrete/AssignedByValParameterInspection.cs b/Rubberduck.CodeAnalysis/Inspections/Concrete/AssignedByValParameterInspection.cs index 100833a3f7..8ac979dc82 100644 --- a/Rubberduck.CodeAnalysis/Inspections/Concrete/AssignedByValParameterInspection.cs +++ b/Rubberduck.CodeAnalysis/Inspections/Concrete/AssignedByValParameterInspection.cs @@ -18,7 +18,7 @@ namespace Rubberduck.Inspections.Concrete /// Mutating the inputs destroys the initial state, and makes the intent ambiguous: if the calling code is meant /// to be able to access the modified values, then the parameter should be passed ByRef; the ByVal modifier might be a bug. /// - /// + /// /// /// - /// + /// /// /// The first assignment is likely redundant, since it is being overwritten by the second. /// - /// + /// /// /// - /// + /// /// - /// + /// /// /// - /// + /// /// /// A Boolean expression never needs to be compared to a Boolean literal in a conditional expression. /// - /// + /// /// /// - /// + /// /// /// Declarations that are never used should be removed. /// - /// + /// /// /// - /// + /// /// /// These declarative statements make the first letter of identifiers determine the data type. /// - /// + /// /// /// Rubberduck annotations should not be specified more than once for a given module, member, variable, or expression. /// - /// + /// /// /// - /// + /// /// /// Case blocks in VBA do not "fall through"; an empty 'Case' block might be hiding a bug. /// - /// + /// /// /// - /// + /// /// /// Dead code should be removed. A loop without a body is usually redundant. /// - /// + /// /// /// - /// + /// /// - /// + /// /// /// - /// + /// /// /// Dead code should be removed. A loop without a body is usually redundant. /// - /// + /// /// /// - /// + /// /// /// Dead code should be removed. A loop without a body is usually redundant. /// - /// + /// /// /// - /// + /// /// /// Conditional expression is inverted; there would not be a need for an 'Else' block otherwise. /// - /// + /// /// /// - /// + /// /// - /// + /// /// /// - /// + /// /// /// Dead code should be removed. A loop without a body is usually redundant. /// - /// + /// /// /// - /// + /// /// - /// + /// /// /// - /// + /// /// /// /// - /// An early-bound, equivalent function likely exists in the object returned by the Application.WorksheetFunction property; - /// late-bound member calls will fail at run-time with error 438 if there is a typo (a typo fails to compile for an early-bound member call). - /// Late-bound worksheet functions will return a Variant/Error given invalid inputs; - /// the equivalent early-bound member calls raise a more VB-idiomatic runtime error given the same invalid inputs. - /// A Variant/Error value cannot be coerced into any other data type, be it for assignment or comparison. - /// Trying to compare or assign a Variant/Error to another data type will throw error 13 "type mismatch" at run-time. - /// Consider using the early-bound equivalent function instead. + /// An early-bound, equivalent function exists in the object returned by the Application.WorksheetFunction property; + /// late-bound member calls will fail at run-time with error 438 if there is a typo (a typo fails to compile for an early-bound member call); + /// given invalid inputs, these late-bound member calls return a Variant/Error value that cannot be coerced into another type. + /// The equivalent early-bound member calls raise a more VB-idiomatic, trappable runtime error given the same invalid inputs: + /// trying to compare or assign a Variant/Error to another data type will throw error 13 "type mismatch" at run-time. + /// A Variant/Error value cannot be coerced into any other data type, be it for assignment or comparison. + /// /// - /// + /// /// /// - /// + /// /// 15 Then ' throws error 1004 - /// ' won't run, error 1004 is thrown when "ABC" is processed by WorksheetFunction.Sum, before it returns. + /// If Application.WorksheetFunction.Sum(Array(1, 2, 3), 4, 5, "ABC") > 15 Then ' raises error 1004 + /// ' won't run, error 1004 is raised when "ABC" is processed by WorksheetFunction.Sum, before it returns. /// End If /// End Sub /// ]]> diff --git a/Rubberduck.CodeAnalysis/Inspections/Concrete/Excel/ExcelMemberMayReturnNothingInspection.cs b/Rubberduck.CodeAnalysis/Inspections/Concrete/Excel/ExcelMemberMayReturnNothingInspection.cs index 0f4808a0ca..5818439f02 100644 --- a/Rubberduck.CodeAnalysis/Inspections/Concrete/Excel/ExcelMemberMayReturnNothingInspection.cs +++ b/Rubberduck.CodeAnalysis/Inspections/Concrete/Excel/ExcelMemberMayReturnNothingInspection.cs @@ -15,7 +15,7 @@ namespace Rubberduck.Inspections.Concrete /// Range.Find methods return a Range object reference that refers to the cell containing the search string; /// this object reference will be Nothing if the search didn't turn up any results, and a member call against Nothing will raise run-time error 91. /// - /// + /// /// /// - /// + /// /// - /// + /// /// /// - /// + /// /// - /// + /// /// /// - /// + /// /// - /// + /// /// /// - /// + /// /// /// + /// /// - /// Inspection only evaluates hard-coded string literals; string-valued expressions evaluating into a sheet name are ignored. + /// For performance reasons, the inspection only evaluates hard-coded string literals; string-valued expressions evaluating into a sheet name are ignored. /// - /// + /// /// /// - /// + /// /// - /// + /// /// /// - /// + /// /// - /// + /// /// /// - /// + /// /// - /// + /// /// /// - /// + /// /// /// Rubberduck is correctly parsing an annotation, but that annotation is illegal in that context. /// - /// + /// /// /// - /// + /// /// - /// + /// /// /// - /// + /// /// /// Code should do what it says, and say what it does. Implicit default member calls generally do the opposite of that. /// - /// + /// /// /// - /// + /// /// - /// + /// /// /// - /// + /// /// /// All functions return something, whether a type is specified or not. The implicit default is 'Variant'. /// - /// + /// /// /// - /// + /// /// - /// + /// /// /// - /// + /// /// - /// + /// /// /// - /// + /// /// - /// + /// /// /// - /// + /// /// - /// + /// /// /// - /// + /// /// - /// + /// /// /// - /// + /// /// /// Some annotations require arguments; if the argument isn't specified, the annotation is nothing more than an obscure comment. /// - /// + /// /// /// - /// + /// /// - /// + /// /// /// - /// + /// /// - /// + /// /// /// - /// + /// /// - /// + /// /// /// - /// + /// /// - /// + /// /// /// - /// + /// /// - /// + /// /// /// - /// + /// /// - /// + /// /// /// - /// + /// /// /// When splitting a long list of parameters across multiple lines, care should be taken to avoid splitting a parameter declaration in two. /// - /// + /// /// /// - /// + /// /// /// Declaration statements should generally declare a single variable. /// - /// + /// /// /// - /// + /// /// /// Both 'Function' and 'Property Get' accessors should always return something. Omitting the return assignment is likely a bug. /// - /// + /// /// /// - /// + /// /// - /// + /// /// /// - /// + /// /// /// The 'Call' keyword is obsolete and redundant, since call statements are legal and generally more consistent without it. /// - /// + /// /// /// - /// + /// /// - /// + /// /// /// - /// + /// /// diff --git a/Rubberduck.CodeAnalysis/Inspections/Concrete/ObsoleteCommentSyntaxInspection.cs b/Rubberduck.CodeAnalysis/Inspections/Concrete/ObsoleteCommentSyntaxInspection.cs index 5b9ceb9dca..c620f5cd30 100644 --- a/Rubberduck.CodeAnalysis/Inspections/Concrete/ObsoleteCommentSyntaxInspection.cs +++ b/Rubberduck.CodeAnalysis/Inspections/Concrete/ObsoleteCommentSyntaxInspection.cs @@ -19,14 +19,14 @@ namespace Rubberduck.Inspections.Concrete /// /// Modern VB comments use a single quote character (') to denote the beginning of a comment: the legacy 'Rem' syntax is obsolete. /// - /// + /// /// /// - /// + /// /// /// The legacy syntax is obsolete; prefer 'Err.Raise' instead. /// - /// + /// /// /// - /// + /// /// /// The legacy syntax is obsolete; use the 'Public' keyword instead. /// - /// + /// /// /// - /// + /// /// /// The legacy syntax is obsolete/redundant; prefer implicit Let-coercion instead. /// - /// + /// /// /// - /// + /// /// /// Marking members as obsolete can help refactoring a legacy code base. This inspection is a tool that makes it easy to locate obsolete member calls. /// - /// + /// /// /// - /// + /// /// /// Type hints were made obsolete when declaration syntax introduced the 'As' keyword. Prefer explicit type names over type hint symbols. /// - /// + /// /// /// - /// + /// /// - /// + /// /// /// - /// + /// /// /// All errors are "local" - the keyword is redundant/confusing and should be removed. /// - /// + /// /// /// - /// + /// /// - /// + /// /// /// - /// + /// /// - /// + /// /// /// - /// + /// /// - /// + /// /// /// - /// + /// /// /// Declarations that are not used anywhere should probably be removed. /// - /// + /// /// Not all unused parameters can/should be removed: ignore any inspection results for /// event handler procedures and interface members that Rubberduck isn't recognizing as such. - /// - /// + /// + /// /// - /// + /// /// /// - /// + /// /// - /// + /// /// Not all unused procedures can/should be removed: ignore any inspection results for /// event handler procedures and interface members that Rubberduck isn't recognizing as such. - /// - /// + /// + /// /// /// - /// + /// /// - /// + /// /// /// - /// + /// /// - /// + /// /// /// - /// + /// /// - /// + /// /// /// - /// + /// /// - /// + /// /// /// - /// + /// /// - /// + /// /// /// - /// + /// /// - /// + /// /// /// - /// + /// /// /// While a great debugging tool, 'Stop' instructions should not be reachable in production code; this inspection makes it easy to locate them all. /// - /// + /// /// /// - /// + /// /// + /// /// diff --git a/Rubberduck.CodeAnalysis/Inspections/Concrete/ThunderCode/LineContinuationBetweenKeywordsInspection.cs b/Rubberduck.CodeAnalysis/Inspections/Concrete/ThunderCode/LineContinuationBetweenKeywordsInspection.cs index a5b071d1af..cffc6f3f8a 100644 --- a/Rubberduck.CodeAnalysis/Inspections/Concrete/ThunderCode/LineContinuationBetweenKeywordsInspection.cs +++ b/Rubberduck.CodeAnalysis/Inspections/Concrete/ThunderCode/LineContinuationBetweenKeywordsInspection.cs @@ -13,7 +13,7 @@ namespace Rubberduck.Inspections.Inspections.Concrete.ThunderCode { - /// + /// /// diff --git a/Rubberduck.CodeAnalysis/Inspections/Concrete/ThunderCode/NegativeLineNumberInspection.cs b/Rubberduck.CodeAnalysis/Inspections/Concrete/ThunderCode/NegativeLineNumberInspection.cs index b5e5b93b90..749a9639a9 100644 --- a/Rubberduck.CodeAnalysis/Inspections/Concrete/ThunderCode/NegativeLineNumberInspection.cs +++ b/Rubberduck.CodeAnalysis/Inspections/Concrete/ThunderCode/NegativeLineNumberInspection.cs @@ -13,7 +13,7 @@ namespace Rubberduck.Inspections.Inspections.Concrete.ThunderCode { - /// + /// /// diff --git a/Rubberduck.CodeAnalysis/Inspections/Concrete/ThunderCode/NonBreakingSpaceIdentifierInspection.cs b/Rubberduck.CodeAnalysis/Inspections/Concrete/ThunderCode/NonBreakingSpaceIdentifierInspection.cs index db1658144b..4886765c01 100644 --- a/Rubberduck.CodeAnalysis/Inspections/Concrete/ThunderCode/NonBreakingSpaceIdentifierInspection.cs +++ b/Rubberduck.CodeAnalysis/Inspections/Concrete/ThunderCode/NonBreakingSpaceIdentifierInspection.cs @@ -8,7 +8,7 @@ namespace Rubberduck.Inspections.Inspections.Concrete.ThunderCode { - /// + /// /// diff --git a/Rubberduck.CodeAnalysis/Inspections/Concrete/ThunderCode/OnErrorGoToMinusOneInspection.cs b/Rubberduck.CodeAnalysis/Inspections/Concrete/ThunderCode/OnErrorGoToMinusOneInspection.cs index 08d930eb41..3e913def92 100644 --- a/Rubberduck.CodeAnalysis/Inspections/Concrete/ThunderCode/OnErrorGoToMinusOneInspection.cs +++ b/Rubberduck.CodeAnalysis/Inspections/Concrete/ThunderCode/OnErrorGoToMinusOneInspection.cs @@ -13,7 +13,7 @@ namespace Rubberduck.Inspections.Inspections.Concrete.ThunderCode { - /// + /// /// diff --git a/Rubberduck.CodeAnalysis/Inspections/Concrete/UnassignedVariableUsageInspection.cs b/Rubberduck.CodeAnalysis/Inspections/Concrete/UnassignedVariableUsageInspection.cs index 9189ee81c6..fb0dbc0bfb 100644 --- a/Rubberduck.CodeAnalysis/Inspections/Concrete/UnassignedVariableUsageInspection.cs +++ b/Rubberduck.CodeAnalysis/Inspections/Concrete/UnassignedVariableUsageInspection.cs @@ -24,7 +24,7 @@ namespace Rubberduck.Inspections.Concrete /// /// This inspection may produce false positives when the variable is an array, or if it's passed by reference (ByRef) to a procedure that assigns it. /// - /// + /// /// /// - /// + /// /// /// If this code compiles, then Option Explicit is omitted and compile-time validation is easily forfeited, even accidentally (e.g. typos). /// - /// + /// /// /// - /// + /// /// - /// + /// /// /// - /// + /// /// - /// + /// /// /// - /// + /// /// /// Not all unreachable 'Case' blocks may be flagged, depending on expression complexity. /// - /// + /// /// - /// + /// /// /// - /// + /// /// - /// + /// /// /// - /// + /// /// - /// + /// /// /// - /// + /// /// /// A variable can be declared and even assigned, but if its value is never referenced, it's effectively an unused variable. /// - /// + /// /// /// - /// + /// /// /// A variable declared without an explicit data type is implicitly a Variant/Empty until it is assigned. /// - /// + /// /// /// - /// + /// /// - /// + /// /// /// - /// + /// /// - + @@ -26,24 +26,6 @@ - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + +