Skip to content
This repository was archived by the owner on Nov 14, 2023. It is now read-only.

Fixed the unsafe regex. - #41

Open
Nils-TUD wants to merge 1 commit into
kbknapp:masterfrom
Nils-TUD:regex
Open

Fixed the unsafe regex.#41
Nils-TUD wants to merge 1 commit into
kbknapp:masterfrom
Nils-TUD:regex

Conversation

@Nils-TUD

Copy link
Copy Markdown

The previous regex missed many occurrences of unsafe, because it required something before and behind the keyword (see #38). Requiring a word boundary fixes that problem.

However, the counting of unsafe code is still fishy. For example, occurrences of "unsafe" in strings are counted as unsafe code. Also, the formatting matters. This counts as 3 unsafe lines:

unsafe {
  func();
}

And this as 1 unsafe line:

unsafe
{
  func();
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant