Is is possible to analyze method level dependencies in IntelliJ Idea Ultimate? - intellij-idea

Is it possible to analyze method-level dependencies in IntelliJ Idea Ultimate 2022?
I want to analyze how methods in a class relate to each other. I am seeking functionality like the DSM matrix, as per the Code -> Analyze Code -> Dependency Matrix tool, but with the entries being methods in a selected class. Here is a screenshot of a module-level view:
What I want is something similar that has methods as rows. Is there a way I can facilitate this type of analysis in IntelliJ Idea 2022?

Please see the Method Call Hierarchy tool that seems to party cover your case: https://www.jetbrains.com/help/idea/viewing-structure-and-hierarchy-of-the-source-code.html

Related

How to add an ABAPDoc for a method that is an enhancement of a standard class?

I have extended a class by one method, using the Enhancement Framework.
Now, my problem is that I want to add ABAPDoc to it but cannot find any way to do it!
The code in the Enhancement Include section seems to be editable in no way.
Is there any way to do it at all? I tried also from ADT in Eclipse but this calls the SAP GUI anyway.
What are you trying to do is indeed impossible.
The enhancement include is a technical object and it cannot be edited from the tab you highlighted, it is auto-generated as you changing pre- and post-methods.
What this tab shows is not an include itself, but the placement of the enh. include within the parent object
If you want to change the method comment from enhancement, you should go to Technical details tab and click on changed object, or just go to the class in SE24 and press to pre/post exit button, and you will end up in the same include:
You can write the ABAPDoc-syntaxed comment, but for me it didn't work, and Eclipse didn't recognized my comment written in SAPGui, maybe you will be luckier.
ABAPDoc team describes this piece in a fuzzy manner, it may be an expected behavior:
This ABAPDoc is only available to ADT and not SE80? I can not use it in SAP GUI development?
You can also write it in the source code and you will get also warnings when you execute a check, but there is no dedicated tools support like source code element information or quick assist (Ctrl+1)
To your principal question, ABAPDoc is a two-way road when viewing: the ABAPDocs can be viewed both from the Eclipse and SE80, and they are automatically showed in SE80 description fields (but only if they are declared synchronized).
But it seems to be a one-way road for edit: they can be created only in ADT Eclipse to be fully compatible. If the object cannot be opened in Eclipse natively like your enhancement you are out of the luck.
I put seems because I am not 100% sure. Maybe on later systems it was fixed, but on my 750 they are not recognized by Eclipse for enhanced methods.
The only reliable way of "editing" via SE80 is writing the comments to descriptions and then importing these SE80 descriptions into ABAPDoc in Eclipse
which is ridiculous in context of your question, so there is no way for you.

Get the results of an (existing) code inspection

I am new to writing intellij plugins, so I apologize in advance if my question might be a bit unclear.
I know that (live) code inspections are achieved via Annotators or LocalInspectionTools. I also know there is an API to write a custom Annotator or Inspection tool and I have seen several examples.
What I do not know (my question): is there a manager/helper/"global inspector" that can provide me with the results of an existing code annotator/inspection process (done by the IDE's plugins or by some 3rd party plugin)?
For instance: I do not want to write a custom Lint annotator/inspection plugin for WebStorm. One can configure JSLint/JSHint inside WebStorm settings. The results of the live inspection can be seen over the current file/current open editor.
I would like to get the results of this live inspection, that occurs in the current open editor (inside my own custom code). For this I am interested in the API to get this annotator/inspector and/or the results it provides.
(I apologize for maybe using annotator and inspection terms in a confusing manner)
If there is another question (which I could not find) that duplicates what I have asked above, please re-direct me.
Thank you in advance!
Andrei.
Unfortunately regular annotating process for the linters is asynchronous so you cannot get the annotation results directly (by calling 'Manager' method).
You can create instances of JSLintInspection, JSHintInspection, etc. and call #createVisitor().visit(File) method but the operation is very slow and you must call it outside of AWT thread.
Also you can try to run the method com.intellij.codeInsight.daemon.impl.DaemonCodeAnalyzerEx#processHighlights but as I mentioned above the annotation results for linters can be not available (or outdated)

Access to debug variables in a Eclipse CDT plugin

I want to create an Eclipse plugin which can get access to the same data that is presented in the variables view when debugging a C/C++ application. For example I want to create a view that can present variables from the debugger in different ways.
I have looked in the CDT Developer guide but couldn't find anything about this.
First I thought I could create a SelectionListener and extract the data I want when the user clicks on a variable in the VariableView but I get an instance of GdbVariableVMNode which is internal and not useful. Can I adapt this into something?
Am I supposed to use the CDebugCorePlugin or is there another interface into CDT debugging?
I found out myself. I can use the org.eclipse.debug.ui.memoryRenderings extension point. It lets me provide a class implementing IMemoryRendering, the init method will provide me with an instance of a IMemoryBlock from which I can get the actual values from debugged variables.

IntelliJ Idea: How to create a custom inspection rule

I'm looking for the way to create inspection to warn about large non-javadoc comments in code. I didn't found any suitable common inspection to do this. It looks like I should create a custom inspection rule. Does anybody know how to do it?
As far as I know, there are two ways to create your own code inspection in IntelliJ IDEA:
(simple but limited way) Creating custom inspection based on "search templates".
(more complex and more powerfull way) Developing an IDEA-plugin (here are the guidlines) using your own InspectionToolProvider implementation as "application-component". Also you may use sources of my inspections-plugin as the starting point.
See http://confluence.jetbrains.com/display/IDEADEV/Developing+Custom+Language+Plugins+for+IntelliJ+IDEA#DevelopingCustomLanguagePluginsforIntelliJIDEA-CodeInspectionsandIntentions. You can look at Open API and Plugin Development forum for assistance.

Tool to verify that each public class has javadoc comment

Please propose some tool to verify that each public class and member has javadoc comment. I'm using IDEA to edit source, but haven't found a options to make javadoc essential.
Thank you very much.
IntelliJ IDEA can checkt it for you. You have to enable Javadoc inspections.
You can set various parameters. Like check only public classes, members and methods.
A tool such as checkstyle do exactly that, among many other checks. You can use it to produce a full report with many different checks for your codebase.
It is common to use it along with bytecode based analysis tools, such as PMD or findbugs, that are used to detect some coding errors, such as dead code, erroneous null checks, and many more.