How does one customize measures/metrics in SonarQube Plugin Development? - plugins

I am developing a plugin for SonarQube 6.5 and want to do a little bit more with measures/metrics. My current domain looks like this:
I would like to know how to add the fields on the left side of the measures domain like this:
It is not in the SonarQube Plugin Development Guide, or in any of their plugin examples.
I am also curious how to display more than one field on a file (when you click on a measure field, it brings you to a file tree):
Normally there is exactly one field displayed in this file view corresponding to one metric. As you can see, in my measure, I have fields for "high", "medium" and "low" security vulnerabilities and I would like to combine them so that they are all displayed on one file.

Related

How to analyze and decide whether used or not in sfdc.com?

I am on-boarded into a project where there are existing Apex Class, Apex Trigger, Aura Component Bundle, Custom Object, Lightning Component, Visualforce Component, and Visualforce Pages.
I am given a task to find out which of there components are currently being used in the sfdc.com system.
Should I start to go through the functional requirement documents first and understand how the system is and then check the code?
Or is there any tool which will help me in showing which sfdc.com components are being used and which are not being used?
Does show dependencies button help in this regard?
Also, for the apex class components which are being used how do I decided from where to start writing the test classes?
Interesting question but might be better for https://salesforce.stackexchange.com/, your problem isn't really a specific coding issue...
Start with running built-in tools that should give you some degree of overview:
Setup -> Storage Usage (so you'll see which objects have 0 records)
Setup -> Optimizer (produces a massive PDF but good overview of over-configured areas which might be maintenance pain, users who don't log in too often, unused reports...)
(At end of Optimizer report you should have bunch of resources / links for example to tool that analyses usage of custom fields, how many % are actually populated)
Setup -> Lightning Experience Transition Assistant -> Get Started -> Discover Phase -> Evaluate... -> Check Readiness. Horrible, I know. But will tell you which Visualforce pages were accessed most recently. Or which buttons aren't on page layouts so if people can't click to get to a VF page - they probably can't run it and could be deleted.
These aren't pixel-perfect, SF confirmed to me that Optimizer looks only at certain standard objects & custom ones but not all (I had significant problems hidden in std object that isn't checked, had to pull info from SF backend manually) but it's a start.
In another question you wrote you don't have any developer tools (Eclipse IDE, VScode etc), just dev console. This will limit your ability to just search the project for references to class X... On VF pages "Where is this used" should help you a bit. There are some browser plugins you might want to check out (https://chrome.google.com/webstore/detail/salesforce-advanced-code/lnkgcmpjkkkeffambkllliefdpjdklmi) or there might be some SF plugins on AppExchange...
Where to start writing unit tests? Heh :) Ideally business would be able to point you in general direction of functionality that most often changes / breaks / is most critical and therefore would benefit from nice harness of tests so maintenance developer won't break functionality.
Failing that you can choose to focus on top 10 classes that have most non-covered lines (attacking them should give you quickest coverage % gains). What I'm trying to say if you have class that has 60 / 100 lines covered by test and another that has 2 / 4 covered - it's better to attack the 1st one, even though it has higher coverage %.
After running all tests in go to Developer Console -> Query Editor. On the bottom tick the checkbox for Tooling API. Query similar to this should be a good start:
SELECT ApexClassorTrigger.Name, NumLinesCovered, NumLinesUncovered
FROM ApexCodeCoverageAggregate
ORDER BY NumLinesUncovered DESC
LIMIT 10

Attribute customization in RTC eclipse UI

I am customizing work item in RTC.
When work item is created in summary attribute, there is a condition that work item shall be saved when summary contains minimum three words e.g "this is summary".
Is it possible to do with eclipse UI customization, without need to create plug in.
I think that the best way will be using regular expression validator.

Filters in Eclipse Birt

I have to create a Web Application using Eclipse Birt, and Apache Tomcat to have it on line.
One report will include a table and a chart, both taking data from MongoDB.
While I succeeded in designing a simple report that accepts parameters from Eclipse Birt suite (based on the tutorials on the Eclipse website), I have troubles in handling a more complex report.
Actually, I wish to create a dynamic filter on-the-fly operating on a single column (i.e. "country") where i can choose the different values (i.e. "USA", "UK"...) and then have the rest of the data visualized in the report be refreshed correspondingly.
I also wish to place the filters in a different section of the report (header or footer...) in the same web page, and not have them chosen before opening the report like the parameters of Eclipse Birt.
Said it differently, I would like to have lookup-fields in the header of the report, to automatically filter the data displayed, so to refresh the query behind the report.
May be the solution could to integrate a report built with Eclipse Birt and MongoDB in a Dynamic Web Application using Eclipse too? Or in a GUI in Eclipse like WindowsBuilder?
Has someone faced this task and can help me?
Thank you so much,
Federico
There is not a simple 'out of the box' solution for what you are describing. But there are solutions.
The first thing to understand is that the BIRT reports as delivered via Apache Tomcat, are intended to be stagnant not dynamic. BIRT pulls the data set, then filters it and delivers it in HTML. This link describes the order of events in report creation.
As far as I am aware there is no way to actually provided the function of filtering the created report in BIRT after the report is created.
But, you can provide the illusion of a filtered report, there are two common methods.
Create multiple tables on one report, representing the display as you want it displayed, then use a button command to hide or show the appropriate tables.
Create multiple reports and have buttons the pass new parameters to a new report that opens in the same window.
There is a third approach that can be used, that gives you similar functionality. Use Cascading Parameters (right click report parameter in Outline > New Cascading Parameter Group). This of course is not the function as you envision it in your description, but can give the results you seem to be wanting.

generic CMS system - Does it exist?

I'm looking for the following... can anybody point me to anything that currently exists in this field? Trying not to reinvent the wheel.
Basically a CMS system where I can setup a Form type though an interface.
Basically say that this type of data has a text field called Name, a Date field called "Start Date" and an email field called "Owner". And that together is a Node type called "Project"
Then a data entry person can go and fill in multiple projects and perhaps save them into different categories.
And then I can export the results as XML or JSON.
Thats the wist list... does something like that exist? or am I going to have to program it fresh?
You could certainly take a look at the open source Hippo CMS - it allows you to create your own content types pretty much in the way you're describing (disclaimer: I'm CTO of the company).
A "document type" in Hippo CMS is both the type definition (which nodes go where, what are they called, what type are they) as well as the form to input the content into. The form is build up from different editing fields, and there are fields available for Date, String, HTML Field and so on. If you need a very specific kind of field, then you can create your own and add it to the installation as a plugin.
Hippo is based on the Java Content Repository specification (JCR), which deals with Nodes in a hierarchical structure. If you're looking for a Java solution - then this might be what you need. But from what you're writing, I think you won't even have the need to dive into the Java internals. You can use the XML Export from the Console web interface to get the content out, or add a REST API that exposes the content either as XML or as JSON. For this, you'll need to go a bit deeper. More info on this is available on the community website.
Feel free to try the online demo installation. After you've logged in as one of the 'admin' users, navigate to the "Browse" perspective and open up the "Configuration" accordeon (it's all the way in the bottom of the screen, right above "Taxonomies"). Here you can work with the Document Types.

Word forms with too many ActiveX checkboxes load slowly

my company's software product has a feature that allows users to generate forms from Word templates. The program auto fills some fields from the SQL database and the user can fill in other data that they desire. So we have a .dotx template that holds the design of the form, and then the user gets the .docx file to fill out when they call it from our program.
The problem we're having is that some of our users have been finding that the forms take an exceptionally long time to open up and then, once open, are so slow to respond (scroll around, etc) that they're unusable. So in my investigations so far, I've found out that the problem systems are one with lower powered CPUs (unfortunately it happens for systems above our system requirements) and the Word forms that cause the problems are ones with large amount of ActiveX style checkboxes on them. I verified that reducing the ActiveX checkboxes fixes the form loading problems.
So I have the following questions about solutions (we're using Word 2007):
1) Is there any way to configure Word, or some other settings, so that there won't be such a strain opening a Word form with lots of ActiveX checkboxes? Any way of speeding up Word's opening?
2) Using Legacy style checkboxes instead of the ActiveX ones makes the forms load fine, but it looks like the user has to double-click the checkbox and change Default Value->Checked. Is there a way to configure it so that they can simply click on the checkbox to tick it? "Legacy Forms" checkbox as a name kind of worries me (Legacy…), does that mean a future version of word at some point wouldn't load the checkboxes because they're "legacy"?
3) Yes, it became clear to me after a little bit of research into solutions that Word is not the tool for the job for forms like I'm describing. InfoPath seems to be exactly what we should have been using all along but unfortunately I wasn't involved in the decision making or development of these forms, just tasked with coming up with a solution.
I'd appreciate answers to any of these, or if anyone has any other ideas for solutions to this problem.
Thanks
I'm about 3 years too late, but if you want a legacy checkbox to act like a checkbox, you have to restrict editing on the document or section. (You can lock just a section, if you want.) Locking--on Word 2010 it's called "Restrict editing"--is an option under either the Developer tab or the Review tab.
If you restrict editing in this way, the user cannot edit the text but can fill in the form field, so if the form field is a checkbox, the user can click the checkbox on or off; if the form field is a text box, the user can fill the text box.
If you choose to lock off just a section, you'll probably want to use continuous section breaks (Page Layout > Breaks > Continuous) and specify which section. (In the space where you choose form editing as your kind of restriction, there's a small link that lets you specify which section or sections are locked.)