Giter Club home page Giter Club logo

asniffer's Issues

Errors while generating class-view json for AVisualizer

Some annotations are missing the field "schema" in jsonAV.

Following a example where the annotations

ConditionalOnMissingBean
ConditionalOnSingleCandidate

are correctly generated, and

org.springframework.context.annotation.Configuration
org.springframework.context.annotation.Import
org.springframework.context.annotation.Conditional

The following json output.

have the schema field missing.

                    {
                      "name": "org.springframework.context.annotation.Configuration",
                      "type": "annotation",
                      "properties": {
                        "aa": "1",
                        "locad": "1",
                        "anl": "0"
                      },
                      "children": []
                    },
                    {
                      "name": "org.springframework.context.annotation.Import",
                      "type": "annotation",
                      "properties": {
                        "aa": "1",
                        "locad": "1",
                        "anl": "0"
                      },
                      "children": []
                    },
                    {
                      "name": "org.springframework.context.annotation.Conditional",
                      "type": "annotation",
                      "properties": {
                        "aa": "1",
                        "locad": "1",
                        "anl": "0"
                      },
                      "children": []
                    },
                    {
                      "name": "ConditionalOnSingleCandidate",
                      "type": "annotation",
                      "properties": {
                        "schema": "org.springframework.boot.autoconfigure.condition",
                        "aa": "1",
                        "locad": "1",
                        "anl": "0"
                      },
                      "children": []
                    },
                    {
                      "name": "ConditionalOnMissingBean",
                      "type": "annotation",
                      "properties": {
                        "schema": "org.springframework.boot.autoconfigure.condition",
                        "aa": "1",
                        "locad": "1",
                        "anl": "0"
                      },
                      "children": []
                    }
                  ]
                }

Correction of some code smells

Using the PMD tool, some codesmells were detected in your project.

We ( @StefaneRibeiro and Me ) would like to contribute to your project, offering suggestions for good practices, trying to remove the following codesmells:

  • LooseCoupling
  • UnnecessaryAnnotationValueElement
  • UnusedPrivateField
  • UnnecessaryConstructor

Asniffer não funcionando normalmente no plugin do InteliJ

Descrição do Problema

Resumo
Ao tentar executar a serialização para JSON dos resultados do ASniffer dentro de um Plugin para InteliJ, recebemos um null pointer. Ao analisar o código, vejo que algumas métricas possuem dados faltantes. Eu não consegui reproduzir esse bug no código em Java e Kotlin, isso apenas acontece no ecossistema do plugin.

Um adendo, por mais que o Null Pointer aconteça apenas no JSONReportCV, eu percebi que os arquivos gerados para o SV e PV estão menores do que os gerados em Kotlin/Java

Trecho com erro

JSONReportCV().generateReport(report, dirPathResults)

Stack Trace

2021-09-16 20:20:38,197 [ 236805]  ERROR - llij.ide.plugins.PluginManager - null 
java.lang.NullPointerException
	at com.github.phillima.asniffer.output.json.d3hierarchy.FetchClassViewIMP.fetchAnnotations(FetchClassViewIMP.java:68)
	at com.github.phillima.asniffer.output.json.d3hierarchy.FetchClassViewIMP.fetchChildren(FetchClassViewIMP.java:28)
	at com.github.phillima.asniffer.utils.ReportTypeUtils.fetchPackages(ReportTypeUtils.java:70)
	at com.github.phillima.asniffer.output.json.d3hierarchy.classview.JSONReportCV.prepareJson(JSONReportCV.java:46)
	at com.github.phillima.asniffer.output.json.d3hierarchy.classview.JSONReportCV.generateReport(JSONReportCV.java:24)
	at com.github.sergioppires.asnifferpluginintegration.services.ASnifferService.runAsniffer(ASnifferService.kt:34)
	at com.github.sergioppires.asnifferpluginintegration.services.ASnifferService.actionPerformed(ASnifferService.kt:17)
	at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:281)
	at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.lambda$actionPerformed$0(ActionMenuItem.java:310)
	at com.intellij.openapi.wm.impl.FocusManagerImpl.runOnOwnContext(FocusManagerImpl.java:286)
	at com.intellij.openapi.wm.impl.IdeFocusManagerImpl.runOnOwnContext(IdeFocusManagerImpl.java:77)
	at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.actionPerformed(ActionMenuItem.java:299)
	at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1967)
	at com.intellij.openapi.actionSystem.impl.ActionMenuItem.lambda$fireActionPerformed$0(ActionMenuItem.java:110)
	at com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:95)
	at com.intellij.openapi.actionSystem.impl.ActionMenuItem.fireActionPerformed(ActionMenuItem.java:110)
	at com.intellij.ui.plaf.beg.BegMenuItemUI.doClick(BegMenuItemUI.java:514)
	at com.intellij.ui.plaf.beg.BegMenuItemUI$MyMouseInputHandler.mouseReleased(BegMenuItemUI.java:544)
	at java.desktop/java.awt.Component.processMouseEvent(Component.java:6652)
	at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3345)
	at java.desktop/java.awt.Component.processEvent(Component.java:6417)
	at java.desktop/java.awt.Container.processEvent(Container.java:2263)
	at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5027)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4859)
	at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4918)
	at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4547)
	at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4488)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2307)
	at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2780)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4859)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:778)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:751)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:749)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:748)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:976)
	at com.intellij.ide.IdeEventQueue.dispatchMouseEvent(IdeEventQueue.java:911)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:840)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:454)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:773)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$9(IdeEventQueue.java:453)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:822)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:507)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

Exemplo

Plugin com o código usado: https://github.com/sergioppires/asniffer-plugin-integration
Projeto Usado como exemplo: https://github.com/spring-projects/spring-retry

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.