coverlet icon indicating copy to clipboard operation
coverlet copied to clipboard

Multiple branch points created for F# string slice

Open rhewitt316 opened this issue 4 years ago • 3 comments

Hello, I have a bit of F# code at https://github.com/rhewitt316/coverlet-fsharp-substring-branch-point-example which contains a simple function that returns a slice of a given string. When I build the project and run through Coverlet 3.1, the line of code that slices the string generates 8 branch points, which drastically elevates the cyclomatic complexity. I am new to F# so I am not sure if I am missing something, but I don't see where the 8 branch points come from. Is this correct behavior?

Thanks in advance

Platform: Red Hat Enterprise Linux 8

rhewitt316 avatar Aug 04 '21 19:08 rhewitt316

I guess those are branch points that the compiler auto generated. We have to look into the compiled assembly to see if we can detect a pattern to ignore them.

daveMueller avatar Aug 04 '21 22:08 daveMueller

At the moment coverlet is "very" tuned for C# compiler(Roslyn) we don't have a lot of F# pattern recognitions. We should improve also for functional friends.

MarcoRossignoli avatar Aug 14 '21 11:08 MarcoRossignoli

This issue is stale because it has been open for 3 months with no activity.

github-actions[bot] avatar Sep 10 '23 01:09 github-actions[bot]