Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-16946] iOS: SDK should have 0 static analyzer errors (it currently has 77)

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2015-02-09T17:08:53.000+0000
Affected Version/sRelease 3.2.2
Fix Version/sRelease 3.5.1, Release 4.0.0
ComponentsiOS
Labelsqe-verified
ReporterMatt Langston
AssigneeChee Kiat Ng
Created2014-05-12T21:13:41.000+0000
Updated2015-02-19T19:40:53.000+0000

Description

The Titanium iOS SDK should have 0 static analyzer errors (it currently has 77). The static analyzer is very accurate and every issue identified by it should be corrected. The majority of these errors are logic errors (e.g. division by zero, dereferencing null pointers, etc.) and memory leaks. Verification method: 1. in Xcode, Product -> Analyze 2. Results will appear, indicating all the analyzer errors After resolving all issues, this should result in 0 analyzer errors.

Attachments

FileDateSize
AlloyServicesDisabled.png2014-12-02T21:15:52.000+000078423
AlloyServicesEnabled.png2014-12-02T21:15:53.000+000093313
TitaniumServicesDisabled.png2014-12-02T21:15:53.000+000069599
TitaniumServicesEnabled.png2014-12-02T21:15:53.000+000083752

Comments

  1. Ingo Muschenetz 2014-05-12

    I agree this is important, but I can't (currently) block on this. If we manage to fix it during the beginning of the QE pass, we could consider merging it in.
  2. Chee Kiat Ng 2014-11-13

    Running static analyzer on the latest SDK results in 129 errors as of date. To create sub tasks and fixes based on types of errors, to make sure we don't break anything without knowing where we broke it.
  3. Vishal Duggal 2014-11-19

    All subtasks resolved
  4. Vishal Duggal 2014-11-21

    Backport to 3_5_X https://github.com/appcelerator/titanium_mobile/pull/6370
  5. Ewan Harris 2014-12-02

    Reopening ticket as I still see warnings in the Xcode projects when using: Mac OSX 10.10.1 Appcelerator Studio, build: 3.4.1.201410281743 Titanium SDK build: 3.5.0.v20141202100219 Titanium CLI, build: 3.4.1 Alloy: 1.5.1 Xcode 6.2 beta I created a default Titanium project and a default Alloy project. When running the analyzer in Xcode I see both memory and dead store errors. I will attach screenshots of the errors for the apps which are the following configurations * Default Titanium *without* services enabled * Default Titanium *with* services enabled * Default Alloy *without* services enabled * Default Alloy *with* services enabled
  6. Vishal Duggal 2014-12-02

    The Memory Leak in AppModule is intentional and in place for LiveView. Ignore that. The Memory Leak in TiBuffer is not really a leak but rather Xcode getting confused over the function name copy. The MemoryLeak in TiNetworkTCPSocketFactory is again not a leak but rather Xcode getting confused over a function name. The two dead store warnings are target dependent. Both of these can be ignored. LeadingSlashRemoved is used on simulators so will show that warning when target is device. AirKey is used on device so will show that warning when target is simulator.
  7. Ingo Muschenetz 2015-01-07

    Which of these can we "hide" using the techniques in here http://clang-analyzer.llvm.org/faq.html? I'd like us to either fix the issues that cause an analyzer warning, or if they are intentional, indicate though another mechanism that we intend the warning to exist. [~vduggal], [~pec1985], [~cng], can one of you please take a look?
  8. Chee Kiat Ng 2015-01-08

    Used
       #ifndef __clang_analyzer__
       #endif
       
    to inform analyzer to skip the lines of codes that created the intentional warnings mentioned above. master PR: https://github.com/appcelerator/titanium_mobile/pull/6548 3_5_X PR: https://github.com/appcelerator/titanium_mobile/pull/6549
  9. Ingo Muschenetz 2015-02-06

    We updated the PRs to ignore the internal errors.
  10. Jon Alter 2015-02-06

    [~ingo] [~cng], I merged those PRs. It looks like there are still 5 warnings.
  11. Chee Kiat Ng 2015-02-09

    [~jalter], I think it's because you were doing the analyzer on the KitchenSink projects within the SDK. If we follow Ewan's testing method on newly created titanium projects, you will get zero warnings. So I didn't resolve those you highlighted just because I wanted to minimize unnecessary changes.
  12. Jon Alter 2015-02-09

    That works, thanks [~cng]
  13. Ewan Harris 2015-02-19

    Verified fix on: Mac OSX 10.10.2 Appcelerator Studio, build: 3.4.2.201502181619 Titanium SDK build: 3.5.1.v20150219103744 Titanium CLI, build: 3.4.2-alpha Alloy: 1.5.1 Xcode 6.1.1 Created a new project and built it, used Xcodes static analyzer and there are no longer any memory or dead store errors. Closing ticket.

JSON Source