rspec/rules/S6389/text/rule.adoc

53 lines
989 B
Plaintext
Raw Normal View History

include::../description.adoc[]
include::../ask-yourself.adoc[]
include::../recommended.adoc[]
== Sensitive Code Example
A hidden BIDI character is present in front of `return`:
----
def subtract_funds(account: str, amount: int):
''' Subtract funds from bank account then ''' ;return
bank[account] -= amount
return
----
The executed code looks like the following:
----
def subtract_funds(account: str, amount: int):
''' Subtract funds from bank account then <RLI>''' ;return
bank[account] -= amount
return
----
== Compliant Solution
No hidden BIDI characters are present:
----
def subtract_funds(account: str, amount: int):
''' Subtract funds from bank account then return; '''
bank[account] -= amount
return
----
include::../see.adoc[]
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
include::../highlighting.adoc[]
'''
endif::env-github,rspecator-view[]