{ "id": "115863", "key": "ALOY-710", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "11113", "key": "ALOY", "name": "Alloy", "projectCategory": { "id": "10400", "description": "Tools for developing applications", "name": "Tooling" } }, "fixVersions": [ { "id": "15909", "description": "Alloy 1.5.0", "name": "Alloy 1.5.0", "archived": false, "released": true, "releaseDate": "2014-09-29" } ], "resolution": null, "resolutiondate": null, "created": "2013-06-13T00:44:28.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "qe-3.1.1", "qe-manualtest" ], "versions": [], "issuelinks": [ { "id": "42253", "type": { "id": "10000", "name": "Blocks", "inward": "is blocked by", "outward": "blocks" }, "inwardIssue": { "id": "138250", "key": "TISTUD-7022", "fields": { "summary": "Code Analyzer: Undefined function is not detected as an error", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "None", "id": "6" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "42252", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "138250", "key": "TISTUD-7022", "fields": { "summary": "Code Analyzer: Undefined function is not detected as an error", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "None", "id": "6" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "updated": "2014-12-03T22:29:45.000+0000", "status": { "description": "This issue was once resolved, but the resolution was deemed incorrect. From here issues are either marked assigned or resolved.", "name": "Reopened", "id": "4", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "12329", "name": "Runtime", "description": "Generic bucket for uncategorized runtime issues" } ], "description": "h5. Problem description\r\n\r\nReport errors relative to Resources compiled code could display an incorrect Line position.\r\n\r\n\r\nIn the following sample, an wrong function name is used inside a Titanium UI object defined in the Markup .XML.\r\nThe function does not exist, Alloy still compile the code and the Code Analyzer completes the analysis. \r\n\r\nThe function is detected as an error, however the number Line is in this case wrong. \r\n\r\nh5. Steps to reproduce\r\n\r\n1. Use the following sample code\r\n\r\nh6. index.js\r\n{code}\r\n\r\n\t\r\n\t\t\r\n\t\r\n\r\n{code}\r\n\r\nh6. index.tss\r\n{code}\r\n\"Window\":{\r\n\tbackgroundColor: 'white'\r\n}\r\n\r\n\"Label\":{\r\n\twidth: Ti.UI.SIZE,\r\n\theight: Ti.UI.SIZE,\r\n\tcolor: \"#000\"\r\n}\r\n\r\n{code}\r\n\r\nh6. index.js\r\n{code}\r\n$.index.open();\r\n{code}\r\n\r\n2. Run the Code Analyzer\r\n3. Results: \"foobar\" is correctly reported as not defined. However, the Line position looks wrong. \r\n\r\nAttaching screenshot and 'Resources/alloy/controllers/index.js'.\r\n\r\n{code}\r\nfunction Controller() {\r\n require(\"alloy/controllers/BaseController\").apply(this, Array.prototype.slice.call(arguments));\r\n arguments[0] ? arguments[0][\"__parentSymbol\"] : null;\r\n arguments[0] ? arguments[0][\"$model\"] : null;\r\n var $ = this;\r\n var exports = {};\r\n var __defers = {};\r\n $.__views.index = Ti.UI.createWindow({\r\n backgroundColor: \"white\",\r\n id: \"index\"\r\n });\r\n $.__views.index && $.addTopLevelView($.__views.index);\r\n $.__views.label = Ti.UI.createLabel({\r\n width: Ti.UI.SIZE,\r\n height: Ti.UI.SIZE,\r\n color: \"#000\",\r\n text: \"Hello, World\",\r\n id: \"label\"\r\n });\r\n $.__views.index.add($.__views.label);\r\n foobar ? $.__views.label.addEventListener(\"click\", foobar) : __defers[\"$.__views.label!click!foobar\"] = true;\r\n exports.destroy = function() {};\r\n _.extend($, $.__views);\r\n $.index.open();\r\n __defers[\"$.__views.label!click!foobar\"] && $.__views.label.addEventListener(\"click\", foobar);\r\n _.extend($, exports);\r\n}\r\n\r\nvar Alloy = require(\"alloy\"), Backbone = Alloy.Backbone, _ = Alloy._;\r\n\r\nmodule.exports = Controller;\r\n{code}\r\n\r\nReports errors on line 30, 30 and 43.\r\n", "attachment": [ { "id": "39794", "filename": "index.js", "author": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-06-13T00:44:28.000+0000", "size": 1105, "mimeType": "text/javascript" }, { "id": "39793", "filename": "Screen Shot 2013-06-12 at 5.34.11 PM.png", "author": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-06-13T00:44:28.000+0000", "size": 23551, "mimeType": "image/png" }, { "id": "50850", "filename": "StudioDetects.png", "author": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "created": "2014-08-28T23:11:58.000+0000", "size": 21605, "mimeType": "image/png" } ], "flagged": false, "summary": "Alloy: Line number reported in the 'Errors' report is not always accurate if referring to a compiled file in the 'Resources' folder.", "creator": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Titanium SDK 3.1.1.v20130612114553\r\nAppcelerator Studio 3.1.1.201306112353\r\nCode Processor 1.0.1-cr4\r\nAlloy 1.1.3-cr", "closedSprints": [ { "id": 147, "state": "closed", "name": "2014 Sprint 13 Alloy", "startDate": "2014-06-23T14:36:08.509Z", "endDate": "2014-07-04T00:00:00.000Z", "completeDate": "2014-07-07T16:06:44.759Z", "originBoardId": 124 } ], "comment": { "comments": [ { "id": "257744", "author": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Adding a clarification:\n\nThe Line number reported in the Errors report is not always accurate if is referring to a compiled file in the Resources folder (for example 'Resource/alloy/controllers/index.js').\n\nWhen the Error is relative to an Alloy file included in the 'app' folder (for example: app/controllers/index.js), the Line number is accurate.\n\n", "updateAuthor": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-06-13T20:56:47.000+0000", "updated": "2013-06-13T20:56:47.000+0000" }, { "id": "310955", "author": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "body": "Using both Appcelerator Studio 3.2.3.201404181520 and the CLI (with the code analyzer installed), I do not get code error information included in the output. Perhaps that feature we removed since this ticket was filed.\r\n\r\nPlease note that the error that would result from the app described in this ticket would be encountered at runtime. The JavaScript engine would throw an error when it reached the end of the controller file without being able to find the missing function. Because the error comes from the JS interpreter, I don't see an easy way to catch the error to have it output source-file line numbers rather than compiled (runtime) file line numbers.", "updateAuthor": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "created": "2014-06-25T19:19:26.000+0000", "updated": "2014-06-25T19:19:26.000+0000" }, { "id": "320916", "author": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "body": "Unable to reproduce the issue using:\r\n\r\nMac OSX 10.9.4\r\nAppcelerator Studio, build: 3.4.0.201408270900\r\nTitanium SDK build: 3.4.0.v20140827165712 \r\nTitanium CLI, build: 3.4.0-dev\r\nAlloy: 1.5.0-dev\r\nTitanium Code Processor 1.1.1\r\n\r\nI added the sample code and then ran the code analysis. There was no error information included in the output, when I ran the code to an Android device I encountered a runtime error for this as predicted by Tim. \r\n\r\nh6.Note\r\n Studio does pick this up and *warns* the user to there not being a definition for the method 'foobar'.", "updateAuthor": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "created": "2014-08-28T23:11:09.000+0000", "updated": "2014-08-28T23:11:09.000+0000" }, { "id": "328524", "author": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "updateAuthor": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-10-17T23:16:37.000+0000", "updated": "2014-10-17T23:16:37.000+0000" }, { "id": "334636", "author": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "updateAuthor": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-12-03T20:57:22.000+0000", "updated": "2014-12-03T20:57:22.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }