Questions tagged [code-inspection]

261 questions
6
votes
2 answers

IntelliJ IDEA and backticks (`)

In our environment, we write template Javascript which has areas where server pre-processing inserts values into the code. An example would look like this: var myVarValue = "`serverProcessedVarValue()`"; In the above, the server runs the…
stackleit
  • 264
  • 4
  • 13
6
votes
1 answer

How to suppress syntax inspection in PyCharm?

I'm using PyCharm 3.4.1 and I have this piece of code in my function: cursor.execute('SELECT distinct "name_{0}", code, sort_order FROM {1}'.format(get_language(), ProgrammeLevel._meta.db_table)) PyCharm correctly recognizes that the string…
Maciek
  • 3,174
  • 1
  • 22
  • 26
6
votes
1 answer

Resharper: Suspicious type conversion or check

So while using ReSharper, I was trying to configure my Code Inspection settings and I ran into an issue with one particular case. When trying to change the 'Suspicious type conversion or check' severity level from Warning to Error, I noticed the…
5
votes
1 answer

ReSharper Inspections: Unknown tools version 17.0

While running the TeamCity ReSharper inspection command-line tools. There is an error "unknown tools version 17.0" with the following details. Inspections (ReSharper) Unknown tools version: 17.0 --- EXCEPTION #1/1 [LoggerException] Message…
5
votes
4 answers

Determine if function includes a specific method

I would like to write some code to check student submissions to ensure that a given function includes np.random.choice. For example: import numpy as np def checkme(z, x=[1,2,3], y=4): tmp = np.random.choice(x, size=y) if z: print("z") …
Btibert3
  • 38,798
  • 44
  • 129
  • 168
5
votes
1 answer

Ignore hardcoded strings on logger statements-IntelliJ

On IntelliJ, I typically enable the inspection to find hard coded strings in Java projects. However, it can generate lot of false positives due to hard coded strings present in logger statements. Is there any way in IntelliJ to ignore logger…
codehammer
  • 876
  • 2
  • 10
  • 27
5
votes
4 answers

IntelliJ suggests wrong @NotNull annotation

IntelliJ is suggesting to import com.sun.istack.internal.NotNull the @NotNull annotation (which is wrong) in the following program: public class Test implements Comparable { @Override public int compareTo(@NotNull Test o) { …
traveh
  • 2,700
  • 3
  • 27
  • 44
4
votes
1 answer

How to avoid validation error "Cannot resolve column 'xy'" for embeddable classes in IntelliJ?

I'm using IntelliJ on a Java/Hibernate project. I've also assigned a data source to that project so most of the JPA validation errors for non existing columns are gone. The only errors remaining are for these columns which are defined in…
GreenTurtle
  • 1,144
  • 2
  • 21
  • 35
4
votes
2 answers

Rails Simple Form Inspection error 'null' is too big for type inference

Not entirely sure if this is an actual problem with my code or if it is potentially a RubyMine bug as it appeared after updating, but not all my forms have the problem. I have a Simple Form that the entire form is being highlighted with the…
4
votes
0 answers

Creating a custom scala inspection in IntelliJ for complex pattern

I would like to create a custom inspection in IntelliJ to warn the use of a return statement inside an anonymous function in scala. For example, lets suppose I want to count the number of values higher than 3 in a Seq (in a very ugly way): val seq =…
4
votes
1 answer

Wrong IntelliJ warning about unescaped characters for xml This is no HTML and the the