tracker issue : CFB-4198451

select a category, or use search below
(searches all categories and all time range)
Title:

Using editor's code formatter can alter code logic

| View in Tracker

Status/Resolution/Reason: Open//

Reporter/Name(from Bugbase): Legorol S. / ()

Created: 07/18/2019

Components: Editor Features, Code Formatting

Versions: 2018

Failure Type: Data Corruption

Found In Build/Fixed In Build: 313943 /

Priority/Frequency: Normal / All users will encounter

Locale/System: English / Windows 10 64 bit

Vote Count: 0

Problem Description:
Using the editor's code formatter can alter lines of code and change business logic, breaking an application. The formatter leaves the code syntactically valid and able to execute, hence the change is very hard to detect. This is a critical and unacceptable fault with the formatter, making it completely unsafe to use.

Steps to Reproduce:
1) Create a new CFM with the following code:
<cffunction name="x">
	<cfscript>
		var y = 0;
		var z = 1;
	</cfscript>
</cffunction>
2) Execute the formatter
3) The code changes to:
<cffunction name="x">
	<cfscript>
		var z = 1;
		var z = 1;
	</cfscript>
</cffunction>

Actual Result:
Notice how "var y=0" became "var z=1", this is not a typo, this is what the formatter does.

Expected Result:
The code formatter must not alter code

Any Workarounds:
None

Attachments:

Comments: