lint

Analyze code with Lint for calls that require permissions

你离开我真会死。 提交于 2020-01-12 08:27:08
问题 I am setting my targetSdkVersion to 23 and therefore I want to implement "Requesting permissions at runtime". (see here) Lint directly calls out if you forget to check the permission and tells you the following: Call requires permission which may be rejected by user: code should explicitly check to see if permission is available (with checkPermission ) or explicitly handle a potential `SecurityException' This is quite nice and I want to analyze my code for any call that I may have forgotten,

Lint warning for bad performance - 80+ Views

依然范特西╮ 提交于 2020-01-11 12:34:14
问题 I am getting this lint warning error: highscores.xml has more than 80 views bad for performance . This is my high scores table that has 15 rows and 3 columns. This is the Lite version of my app and my paid version is going to hold 30 rows. My question is how can I optimize this code? There has to be a better way. highscores.xml <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/relativelayout" android

how to create an empty array

断了今生、忘了曾经 提交于 2020-01-07 07:09:33
问题 UPDATE The original description below has many errors; gawk lint does not complain about uninitialized arrays used as RHS of in . For example, the following example gives no errors or warnings. I am not deleting the question because the answer I am about to accept gives good suggestion of using split with an empty string to create an empty array. BEGIN{ LINT = "fatal"; // print x; // LINT gives error if this is uncommented thread = 0; if (thread in threads_start) { print "if"; } else { print

how to create an empty array

旧时模样 提交于 2020-01-07 07:09:10
问题 UPDATE The original description below has many errors; gawk lint does not complain about uninitialized arrays used as RHS of in . For example, the following example gives no errors or warnings. I am not deleting the question because the answer I am about to accept gives good suggestion of using split with an empty string to create an empty array. BEGIN{ LINT = "fatal"; // print x; // LINT gives error if this is uncommented thread = 0; if (thread in threads_start) { print "if"; } else { print

Suspicious pointer-to-pointer conversion (area too small)

£可爱£侵袭症+ 提交于 2020-01-06 12:41:33
问题 I am getting this warning for my logic - Logic : uint8_t *m_data; uint32_t* datap = (uint32_t*)m_data; Warning: Info 826: Suspicious pointer-to-pointer conversion (area too small) As it is required to typecast the value during assignment ..And i am not feeling there is something wrong in given line of code ..how I can suppress this warning or remove it from build 回答1: That's not a correct cast, you're attempting to interpret a pointer to a byte as a pointer to 4 bytes, and can lead to

Lint for ASP.NET MVC?

我是研究僧i 提交于 2020-01-05 08:11:32
问题 Is there a lint utility for ASP.NET MVC? Given that I frequently specify views and links via strings, when I move things around or change entity names I often break things, which I then only find out about when something fails at runtime. 回答1: ReSharper's v6 (whose nightlies are now available, if you don't mind living on the edge) will catch this kind of error for you. 回答2: You can use Refactor -> Rename and enable Search in Strings to replace every string in the solution 回答3: Other option --

Any tips for speeding up static analysis tool PC-Lint? Any experiences using .LOB files?

我是研究僧i 提交于 2020-01-02 15:03:24
问题 I'm interested in learning the main factors which affect PC-lint-ing time. I'm aware of a few such as -passes(#) which will increase the time PC-Lint takes (increase linearly?) or that reducing the messages which are output does not affect the linting time. I'm hoping to verify my understanding of lint's performance by having one of you who is more experienced with lint list the main factors they've encountered that affect linting time. Also, do any of you have experience using .lob files

Android - set all lint warnings as errors except for certain ones

隐身守侯 提交于 2020-01-02 01:23:41
问题 I am trying to make my continuous integration fail the build when new lint warnings that aren't in the lint-baseline.xml file are introduced. I want to have all lint warnings treated as errors (so the build is aborted), but I'd like a way to specify certain lint checks to be treated as informational or warning level so that they still appear in the lint results, but don't cause the build to be aborted. Here is an example of basically what I'd like to do (except this doesn't work, the build

Firestore: Invalid package reference in library

狂风中的少年 提交于 2020-01-02 00:52:12
问题 After updating to com.google.firebase:firebase-firestore:16.0.0 I get the following lint error: Error: Invalid package reference in library; not included in Android: javax.naming.directory. Referenced from io.grpc.internal.DnsNameResolver.JndiResolver. [InvalidPackage] Error: Invalid package reference in library; not included in Android: javax.naming. Referenced from io.grpc.internal.DnsNameResolver.JndiResolver. [InvalidPackage] Seems that the grpc dependency is making lint unhappy. How can

Android data binding dependency conflict with the support library

有些话、适合烂在心里 提交于 2020-01-02 00:13:11
问题 I'm trying to set up data binding in my Android project like so: dataBinding { enabled = true } However, when I add a support library dependency, lint complains: All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 25.1.0, 21.0.3. Examples include 'com.android.support:animated-vector-drawable:25.1.0' and 'com.android.support:support-v4:21.0.3' When I run ./gradlew app:dependencies , I get the following: .