Structural Flaw Occurrences


Overview

Get the findings for a given structural flaw detection pattern. The findings are organized by objects and objects are ordered by the object name, then the findings are ordered using an internal key, then the bookmarks or steps are orderered by a logical rank.

URI

GET /rest/applications/{name}/insights/structural-flaws/detection-patterns/{id}/occurrences

Path parameters

name (string)

This parameter identifies the analyzed application. The application name must be properly encoded if it is required. Character back-quote is not allowed.

id (integer)

The Structural Flaw detection pattern ID.

Query parameters

limit (integer)

Required. The maximum number of objects to return.

skip (integer)

Optional. The number of objects to skip before including objects in the search limit.

Responses

The response structure depends on the finding type:

  • “bookmark”: the finding is a primary bookmark of the source code, followed by a set of complementary bookmarks.
  • “path”: the finding is an ordered set of call stack steps.

Finding type is “bookmark”

application/json
[
    {
        "type": "bookmark",
        "findings": [
            {
                "key": "26679:13:361325",
                "bookmarks": [
                    {
                        "rank": 1,
                        "endCol": 40,
                        "fileId": -4652,
                        "endLine": 130,
                        "startCol": 4,
                        "startLine": 130
                    }
                ]
            },
            ...
          }
        ],
        "object": {
          "fullName": "DEFAULT.M_PriceList_Create",
          "id": "26679",
          "mangling": "M_PriceList_Create()",
          "name": "M_PriceList_Create",
          "type": "Oracle Procedure",
          "typeId": "SQLScriptProcedure"
        },
  },
      ...
]

JSON representation

PropertyTypeDescription
keystringInternal key for traceability.
typestringThe Finding type.
findings[]structureA finding is a set of bookmarks: a primary bookmark followed by secondary bookmarks.
findings[].bookmarks[].rankintegerThe bookmark rank, rank=1 is a primary bookmark.
findings[].bookmarks[].fileIdintegerThe source code file ID.
findings[].bookmarks[].startColintegerThe start column of this finding in the source code file.
findings[].bookmarks[].startLineintegerThe start line of this finding in the source code file.
findings[].bookmarks[].endColintegerThe end column of this finding in the source code file.
findings[].bookmarks[].endLineintegerThe end line of this finding in the source code file.
object.idstringThe source object ID.
object.namestringThe source object name.
object.fullNamestringThe source object long name, usually locates the object in a software architecture.
object.manglingstringThe function signature or an empty string if not applicable.
object.typestringThe source object type for a display.
object.typeIdstringThe source object type identifier is the type reference key.

Finding type is “path”

application/json
[
    {
        "type": "path",
        "object": {
              "fullName": "org.eevolution.model.MPPMRP.C_Order",
              "id": "418848",
              "mangling": "C_Order(org.compiere.model.MOrder) return void",
              "name": "C_Order",
              "type": "Java Method",
              "typeId": "JV_METHOD"
        },
        "findings": [
            {
                "key": "418848:277642",
                "path": [
                  {
                    "rank": 1,
                    "fileId": -7373,
                    "endLine": 723,
                    "startLine": 723
                  },
                  {
                    "rank": 2,
                    "fileId": -7373,
                    "endLine": 781,
                    "startLine": 781
                  },
                  ...
            }
    },
    ...
]

JSON representation

PropertyTypeDescription
keystringInternal key for traceability.
typestringThe Finding type.
findings[]structureA path is a an array of call steps.
findings[].path[]arrayA call step of a path.
findings[].path[].rankintegerThe step rank.
findings[].path[].fileIdintegerThe source code file ID.
findings[].path[].startColintegerThe start column of this finding in the source code file.
findings[].path[].startLineintegerThe start line of this finding in the source code file.
findings[].path[].endColintegerThe end column of this finding in the source code file.
findings[].path[].endLineintegerThe end line of this finding in the source code file.
object.idstringThe source object ID.
object.namestringThe source object name.
object.fullNamestringThe source object long name, usually locates the object in a software architecture.
object.manglingstringThe function signature or an empty string if not applicable.
object.typestringThe source object type for a display.
object.typeIdstringThe source object type identifier is the type reference key.