NDepend - Baseline Coverage by Assembly Query - code-coverage

is it possible to have a comparison by assembly to the baseline build?
At the moment I have a report that shows the coverage by assembly, but I would like to add the coverage compared to the baseline build for each assembly as well side by side.
How would a query look like?
Thanks a lot.

This can be achieved with such CQLinq code query:
from a in Application.Assemblies
select new { a, a.PercentageCoverage,
olderCov = a.OlderVersion() == null ? -1 :
a.OlderVersion().PercentageCoverage,
diffCov = a.OlderVersion() == null ? -1 :
a.PercentageCoverage - a.OlderVersion().PercentageCoverage
}
Here is a screenshot of the result:
Several points:
The query can be easily rewritten to show diff of other coverage metrics like a.NbLinesOfCodeCovered for example
This query can be easily transformed into a rule for example if any coverage ratio is decreasing (related doc)
Or if you prefer it not to be a rule but still gets this query result in the report, just use this feature (List code queries of this group in the report)

Related

Apache Jena: adding GraphNode (N3 formula) to Model (ARQInternalErrorException)

I'm attempting to add a Graph node to a Model (N3 formula)
The output should be roughly like the below:
<http://localhost:8080/patches/#cf0ba48fa8b0421c8b025c3ea6b41a4f>
a <http://www.w3.org/ns/solid/terms#Patch> ;
<http://www.w3.org/ns/solid/terms#patches>
<http://example.com/#me> ;
<http://www.w3.org/ns/solid/terms#inserts> { http://example.com/#me http://example.com/#property http://example.com/#resource } .
Note that the #inserts property here is a "GraphNode" or N3 formula, I'm modelling a graph of the triples to write when a Task is complete
I tried the code below:
Model out = ModelFactory.createDefaultModel();
out.add(endState, SolidTerms.inserts, out.asRDFNode(NodeFactory.createGraphNode(inserts.getGraph())));
but this throws [org.apache.jena.sparql.ARQInternalErrorException: Unknown node type: {http://example.com/#me #http://example.com/#property http://example.com/#resource}]
I've tried many other ways of putting the Graph in the model with no success, posting this one because it was my first and I think the most rational. Maybe it's a bug or Jena just doesn't support the GraphNode type in RDFNode ?
The # in the output puzzled me a bit, but I checked that it's not included in my property definition, it's maybe added in by the createGraphNode or the error serialization

How to read out a list of cases in one variable in SPSS and use that to add data?

To explain my problem I use this example data set:
SampleID Date Project Problem
03D00173 03-Dec-2010 1,00
03D00173 03-Dec-2010 1,00
03D00173 28-Sep-2009 YNTRAD
03D00173 28-Sep-2009 YNTRAD
Now, the problem is that I need to replace the text "YNTRAD" with "YNTRAD_PILOT" but only for the cases with Date = 28-Sep-2009.
This is example is part of a much larger database, with many more cases having Project=YNTRAD and Data=28-Sep-2009, so I can not simply select first all cases with 28-Sep-2009, then check which of these cases have Project=YNTRAD and then replace. Instead, what I need to do is:
Look at each case that has a 1,00 in Problem (these are problem
cases)
Then find the SampleID that corresponds with that sample
Then find all other cases with the same SampleID BUT WITH
Date=28-Sep-2009 (this is needed because only those samples are part
of a pilot study) and then replace YNTRAD in Project to
YNTRAD_PILOT.
I read a lot about:
LOOP
- DO REPEAT
- DO IF
but I don't know how to use these in solving this problem.
I first tried making a list containing only the sample ID's that need eventually to be changed (again, this is part of a much larger database).
STRING SampleID2 (A20).
IF (Problem=1) SampleID2=SampleID.
EXECUTE.
AGGREGATE
/OUTFILE=*
/BREAK=SampleID2
/n_SampleID2=N.
This gives a dataset with only the SampleID's for which a change should be made. However I don't know how to read out this dataset case by case and looking up each SampleID in the overall file with all the date and then change only those cases were Date = 28-Sep-2009.
It sounds like once we can identify the IDs that need to be changed we've done the tricky part here. We can use AGGREGATE with MODE=ADDVARIABLES to add a problem Id counter variable to our dataset. From there, it's as you'd expect.
* Add var IdProblemCnt to your database . Stores # of times a given Id had a record with Problem = 1.
AGGREGATE
/OUTFILE=* MODE=ADDVARIABLES
/BREAK=SampleId
/IdProblemCnt=CIN(Problem, 1, 1) .
EXE .
* once we've identified the "problem" Ids we can use `RECODE` Project var.
DO IF (IdProblemCnt>0 AND Date = DATE.MDY(9,28,2009) .
RECODE Project ('YNTRAD' = 'YNTRAD_PILOT') .
END IF .
EXE .

Esper How to express dependecies between sentences

I'm a novice in using the Esper event stream engine in Java.
I want to detect some alerts in the folowing way
If condition-A then Alert-A
If condition-B then Alert-B
If condition-C and (not Alert-A and not Alert-B) then Alert-C
The conditions are not exclusives.
In the scenario of temperatures will be to to test if the temperature > 50, 100, 150 for example (my scenario is more complex)
I don’t know how to solve this problem.
I have tried with #priority and #drop, but without success (I think that the engine doesn’t take into account) I have put
config.getEngineDefaults().getExecution().setPrioritized(true);
And the EPL sentences are:
#Name('critical')
#Drop
#Priority(9)
Insert into AlertEvent
select *, 'critical' as type
from TemperatureEvent (reading > 100)
#Name('warning')
Insert into AlertEvent
select *, 'warning' as type from TemperatureEvent (reading > 200)
Any temperature event classified as 'warning', it is also classified as ‘critical’.
Any way, I would prefer a solution without priority and drop,
Any clue?
Esper has a splitting and duplicating syntax that provides a convenient way. Its described in [1]. I have not tested the below for you but it should be close:
on TemperatureEvent(reading > 100)
insert into AlertEvent select ... where reading > 200
insert into AlertEvent select ...
[1] http://esper.codehaus.org/esper-5.0.0/doc/reference/en-US/html_single/index.html#split_overview

Why does our SiteCatalyst Searches report of shows 'N/A' values

Our company has a "Traffic Source" report that shows "Search Keyword - All" broken down by a conversion variable that "stacks" keywords from search engines using crossVisitParticipation and channelManager plugins/functions. The conversion variables and the referring url are transmitted to Omniture correctly (I verified that by the SC Debugger).
The problem is that when we choose the "Searches" metric the values show "N/A". Why would this happen? Do we have something configured wrong?
Here is photo of our report:
http://i.imgur.com/79x3g.jpg
Here is a similar report with the keyword stack by pages. It has the same problem.
http://i.imgur.com/iQhbK.jpg
Here is a javascript snip of code that sets the conversion var:
var o=s.channelManager(false);
if(typeof o != 'undefined' && o.keyword != 'n/a' && o) {
s.eVar24=s.crossVisitParticipation(o.keyword,'s_kw','90','9',' > ','event4,purchase,1');
}
Thanks!
The issue is exactly what Adam Greco wrote up there. The 'Searches' metric is the same as the instances metric. Neither of which are subrelated, which means the metric relates only to the conversion variable it is set against.
So when you do a breakdown on your Search Keywords by the Keyword Stack the Searches metric doesn't apply to the Stack values on rows below - thus n/a, or 'not applicable'.
Try adding the Visits metric instead.

Report Builder: How do MDX filter expressions work in Query Designer?

I'm trying to write some reports against a TFS cube. I'd like to utilize query builder since I'm fairly new to MDX and I'd prefer not to write the entire query; however, it doesn't seem very easy to inject MDX into the query designer's dimension filter expressions. Is there a special syntax to enter them in?
For instance, say I want to show the top 10 heaviest code churn dates in a certain date range. In the query designer:
I drop in a Date dimension and mark it as a parameter.
I drop in the Version Control Changeset, set hierarchy to Changeset Id, operator to MDX.
I then use the filter expression builder to construct TOPCOUNT([Version Control Changeset].[Changeset ID], 10, [Measures].[Total Churn])
Back in the query designer, I set Date, Changeset ID, and Total Churn to be my columns.
The generated query is as follows:
SELECT NON EMPTY { [Measures].[Total Churn] } ON COLUMNS, NON EMPTY { ([Date].[Date].[Date].ALLMEMBERS * [Version Control Changeset].[Changeset ID].[Changeset ID].ALLMEMBERS ) } DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS FROM ( SELECT ( TOPCOUNT([Version Control Changeset].[Changeset ID], 10, [Measures].[Total Churn]) ) ON COLUMNS FROM ( SELECT ( STRTOSET(#DateYearMonthDateHierarchy, CONSTRAINED) ) ON COLUMNS FROM [Code Churn])) WHERE ( IIF( STRTOSET(#DateYearMonthDateHierarchy, CONSTRAINED).Count = 1, STRTOSET(#DateYearMonthDateHierarchy, CONSTRAINED), [Date].[Year - Month - Date Hierarchy].currentmember ) ) CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS
However, both in the query designer's preview area and when I run the report, it's as if the TOPCOUNT isn't being applied and instead of seeing the top 10, I see all of them. The expression parses correctly; it just doesn't seem to do anything. Is there an easy gotcha that I've missed?
Thanks!
Based on your goal...to show the top 10 heaviest code churn dates in a certain date range
I think your MDX expression is wrong...
TOPCOUNT([Version Control Changeset].[Changeset ID], 10, [Measures].[Total Churn])
Try this instead...
TOPCOUNT(
(
[Date].[Date].[Date].ALLMEMBERS *
[Version Control Changeset].[Changeset ID]
)
,10
,[Measures].[Total Churn]
)
...also, I have found this utility very useful when working with MDX generated from the MS integrated query designers.

Resources