Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
titleJSON
languagejavascript
[
  {
    "id":73907420,
    "message":"Bad comparison of nonnegative value with -1 in org.sonar.channel.CodeReader.peekTo(EndMatcher,Appendable)",
    "line":117,
    "priority":"CRITICAL",
    "createdAt":"2012-06-02T23:32:49+0000",
    "rule":
      {
        "key":"findbugs:INT_BAD_COMPARISON_WITH_NONNEGATIVE_VALUE",
        "name":"Correctness - Bad comparison of nonnegative value with negative constant"
      },
    "resource":
      {
        "key":"org.codehaus.sonar:sonar-channel:org.sonar.channel.CodeReader",
        "name":"CodeReader",
        "scope":"FIL",
        "qualifier":"CLA",
        "language":"java"
      }
	"review":
      { see /api/review web service }
  },
  ...
]
Info
titleNumber of results

Note that the number of results is limited to 5,000. See SONAR-3257.

Parameters

Parameter

Description

Required

Default Value

Example Value

resource

id or key of the resource.

Yes

None

org.codehaus.sonar:sonar

depth

Used only when resource is set. 

  • 0: only selected resource 
  • -1: all children, including selected resource 
  • >0: depth toward the selected resource
No

0

-1

scopes

Comma-separated list of scopes:

  • PRJ: project/module 
  • DIR: directory (like Java package) 
  • FIL: file
No

None

PRJ,FIL

qualifiers

Comma-separated list of qualifiers: 

  • VW: view
  • SVW: sub-view
  • TRK: project 
  • BRC: module 
  • CLA: class 
  • UTS: unit test 
  • DIR: directory 
  • FIL: file
  • DEV: developer
No

None

TRK,BRC

rules

Comma-separated list of rule keys or ids.

No

None

squid:MethodCyclomatiComplexity,pmd:ConstructorCallsOverridableMethod

priorities

Comma-separated list of priorities.
Possible values: BLOCKER | CRITICAL | MAJOR | MINOR | INFO

No

None

BLOCKER,CRITICAL

limit

Maximum number of results

No

5000

10

include_review

Include review data into response.
Possible values: true | false

No

false

true

output

Output format of review comments. Ignored if include_review is false.
Possible values: PLAIN | HTML 

No

PLAIN

HTML

switched_off

If true, then return only switched-off violations (usually false-positives), 
else switched-off violations are excluded.
Possible values: true | false 

No

false

true
format

Response format

.

Possible values

can be set through:

  • Parameter format: xml | json
  • Or the 'Accept' property in the HTTP header:
    • Accept:text/xml
    • Accept:application/json
If nothing is set, json is used.
NoNonejson