Skip to content

Commit

Permalink
Static analysis + fantomas
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveGilham committed Mar 9, 2022
1 parent 585b4d0 commit 94c1321
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions AltCover.Engine/Visitor.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1220,8 +1220,10 @@ module internal Visitor =
lastOfSequencePoint dbg n

let rec internal firstOfSequencePoint (dbg: MethodDebugInformation) (i: Instruction) =
if (i |> dbg.GetSequencePoint).IsNotNull then i
else firstOfSequencePoint dbg i.Previous
if (i |> dbg.GetSequencePoint).IsNotNull then
i
else
firstOfSequencePoint dbg i.Previous

let internal getJumps (dbg: MethodDebugInformation) (i: Instruction) =
let terminal = lastOfSequencePoint dbg i
Expand Down Expand Up @@ -1336,7 +1338,9 @@ module internal Visitor =
before.OpCode = OpCodes.Ldloc_0
&& sp.IsNotNull
&& sp.IsHidden
&& (let v0t = dbg.Method.Body.Variables.[0].VariableType
&& (let v0t =
dbg.Method.Body.Variables.[0].VariableType

v0t.MetadataType = MetadataType.Int32) // state machines do this

[ rawInstructions |> Seq.cast ]
Expand Down Expand Up @@ -1523,4 +1527,11 @@ module internal Visitor =
| Some dict ->
match dict.TryGetValue file with
| (true, url) -> url
| _ -> I.locateMatch file dict
| _ -> I.locateMatch file dict

[<assembly: SuppressMessage("Gendarme.Rules.Smells",
"AvoidMessageChainsRule",
Scope = "member", // MethodDefinition
Target = "AltCover.Visitor/I/generated@1335::Invoke(Mono.Cecil.Cil.Instruction)",
Justification = "No direct call available")>]
()

0 comments on commit 94c1321

Please sign in to comment.