Questions tagged [intellij-inspections]

37 questions
1
vote
1 answer

How to create a custom IntelliJ IDE inspection based on regex?

Is it possible to create a custom IntelliJ IDEA inspections that detects code matching a certain regex? If so: how? For example I want to spot places in the code where the key for a lookup in a Map is created inside the square brackets: val x =…
deamon
  • 89,107
  • 111
  • 320
  • 448
1
vote
2 answers

Unchecked call to ifPresent inspection, why?

My code: public static boolean searchLineOnLogFile(String...keywords) { Collection select = null; try (final Stream lines = Files.lines(get(getServerLog().toString()))) { select =…
Catchy
  • 29
  • 3
1
vote
0 answers

IntelliJ IDE with Cursive (Clojure): Custom Inspection

I'm using the Cursive plugin with IntelliJ to write Clojure. I'd like to add two code inspections that don't come with Cursive: functions longer than 15 LOC and defn forms whose documentation string is (accidentally) located after the parameter…
John Dorian
  • 1,884
  • 1
  • 19
  • 29
1
vote
0 answers

Restrict IntelliJ only to only inspect current file

IntelliJ IDEA performs a lot of checks while typing code. This is ok so far but I realized that it is doing this for all visible files. I like to have many files open parallel but this causes my cpu to be high performance heating system. I see a…
Marcel
  • 4,054
  • 5
  • 36
  • 50
1
vote
1 answer

How to use shared scope in PhpStorm

As PhpStorm has mentioned that we can create 2 types of scope: local & shared. How to use Shared scope for multiple developers??
Sumit
  • 11
  • 3
0
votes
0 answers

Check implementation of IntelliiJ inspections

I would like to create a custom inspection in IntelliJ. I found this official documentation from JetBrains: https://www.jetbrains.com/help/idea/creating-custom-inspections.html https://www.jetbrains.com/help/idea/search-templates.html However, I…
0
votes
1 answer

How do I disable "simplify chained comparison" in PyCharm?

I understand that a statement like if x > y and y > z: pass can be simplified to if x > y > z: pass but honestly I prefer to have the first one, don't judge me please. Is there a way to disable this option in PyCharm, or maybe a way to not…
why
  • 37
  • 4
0
votes
0 answers

Where did my errors go for PhpStorm (mac)

PhpStorm: 2021.2.2 OS: Mac OSX Catalina I am working in the latest version of PhpStorm, and let me give you a couple of examples as I am sure its a setting some where I need to turn on: Consider this PHP function: /** * Use rings. * * Only the…
TheWebs
  • 12,470
  • 30
  • 107
  • 211
0
votes
0 answers

Copy of Java Project fails due to IntelliJ Inspection Profiles

Context: I am trying to copy my Java Project from one drive to another. Issue: The copy stops, as it is unable to copy the Project_Default.xml file from .idea-> inspectionProfiles to destination. Only if I skip this, will I be able to copy the…
iCoder
  • 1,406
  • 6
  • 16
  • 35
0
votes
1 answer

Disable Inspections for a specific PsiElement subclass

I developed a Custom Language plugin based on this this tutorial. Now I'd like to disable/suppress Inspection with message Non-ASCII characters in an identifier for specific identifiers via Plugin API. I use these identifiers which start with '#' as…
schmidt9
  • 4,436
  • 1
  • 26
  • 32
0
votes
0 answers

Preventing warning 'GrEqualsBetweenInconvertibleTypes' when using '==' with a class implementing Comparable (Groovy)

Note that this question pertains to Groovy ('==' means equality rather than identity) and IntelliJ IDEA (but I don't believe this issue to be IDE-specific). I have a class that implements comparable below: class Money implements Comparable { …
Kurt
  • 23
  • 4
0
votes
2 answers

Can I suppress IntelliJ "Unused declaration" inspection for fields?

I would like to suppress the "Unused declaration" inpection in IntelliJ (2021.1, also tested on 2020.2) for all fields matching a certain pattern. I was able to suppress the warning for methods using the "Code patterns", but fields don't seem to be…
0
votes
1 answer

Resolve generic type in IntelliJ plugin codecheck

I write an IntelliJ Plugin that performs some checks on Java code. For one of these checks I need to know the type of a generic field. Example: // Model classes B and D public class B { void doB() { } } public class D extends B { void…
Flat Eric
  • 7,971
  • 9
  • 36
  • 45
0
votes
0 answers

Code inspection is not working! Intellij IDE

I am having problems with intellijs Ultimate code inspection! It is only showing me the basic inspection/alternatives for code replacement like "Invert if condition" and nothing else. I have checked on the preferences if everything is selected and…
Fazli Zekiqi
  • 531
  • 2
  • 7
  • 14
0
votes
1 answer

How to not inspect error on raw_input with Python 2 compatible code

I have a Python module that can be run with both Python 2 and Python 3. At some point, the module takes a user input. How it does so depends on the Python major version: Python 2: use raw_input Python 3: use input My IDE is PyCharm, and my…