ISO-5055 Occurrences

Draft

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

URI

  • GET /rest/applications/{name}/insights/iso-5055/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 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.
  • “integer”: the finding is an integer.
  • “number”: the finding is a float number.
  • “percentage”: the finding is a float number expressed as a percentage.
  • “text”: the finding is a text.
  • “object”: the finding is an object full name.
  • “no-value”: the finding is the object itself.
  • application/json: Finding type is “bookmark”

    [
        {
            "type": "bookmark",
            "findings": [
                {
                    "key": "26679:13:361325",
                    "bookmarks": [
                        {
                            "rank": 1,
                            "endCol": 40,
                            "fileId": -4652,
                            "relativePath": "...",
                            "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

    Property Type Description
    key string Internal key for traceability.
    type string The Finding type.
    findings[] structure A finding is a set of bookmarks: a primary bookmark followed by secondary bookmarks.
    findings[].bookmarks[].rank integer The bookmark rank, rank=1 is a primary bookmark.
    findings[].bookmarks[].fileId integer The source code file ID.
    findings[].bookmarks[].relativePath string The source code relative file path.
    findings[].bookmarks[].startCol integer The start column of this finding in the source code file.
    findings[].bookmarks[].startLine integer The start line of this finding in the source code file.
    findings[].bookmarks[].endCol integer The end column of this finding in the source code file.
    findings[].bookmarks[].endLine integer The end line of this finding in the source code file.
    object.id string The source object ID.
    object.name string The source object name.
    object.fullName string The source object long name, usually locates the object in a software architecture.
    object.mangling string The function signature or an empty string if not applicable.
    object.type string The source object type for a display.
    object.typeId string The source object type identifier is the type reference key.
  • application/json: Finding type is “path”

    [
        {
            "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

    Property Type Description
    key string Internal key for traceability.
    type string The Finding type.
    findings[] structure A path is a an array of call steps.
    findings[].path[] array A call step of a path.
    findings[].path[].rank integer The step rank.
    findings[].path[].fileId integer The source code file ID.
    findings[].path[].relativePath string The source code relative file path.
    findings[].path[].startCol integer The start column of this finding in the source code file.
    findings[].path[].startLine integer The start line of this finding in the source code file.
    findings[].path[].endCol integer The end column of this finding in the source code file.
    findings[].path[].endLine integer The end line of this finding in the source code file.
    object.id string The source object ID.
    object.name string The source object name.
    object.fullName string The source object long name, usually locates the object in a software architecture.
    object.mangling string The function signature or an empty string if not applicable.
    object.type string The source object type for a display.
    object.typeId string The source object type identifier is the type reference key.
  • application/json: Finding type is “string”

    [
        {
    
        "type": "string",
        "title": "...",
        "findings": [
            {
                "key": "6749",
                "fileId": -3882,
                "relativePath": "...",
                "text": "..."
            }
        ],
        "object": {
          "fullName": "DEFAULT.AD_Column_Sync",
          "id": "6749",
          "mangling": "AD_Column_Sync()",
          "name": "AD_Column_Sync",
          "type": "Oracle Procedure",
          "typeId": "SQLScriptProcedure"
        },
    },
    ...
    

    ]

    JSON Representation

    Property Type Description
    key string Internal key for traceability.
    title string The Finding title.
    type string The Finding type.
    findings[] structure A finding is a text extracted from a source code.
    findings[].key string An internal finding key.
    findings[].fileId integer The source code file.
    findings[].relativePath string The source code relative file path.
    findings[].text string The finding as a text.
    object.id string The source object ID.
    object.name string The source object name.
    object.fullName string The source object long name, usually locates the object in a software architecture.
    object.mangling string The function signature or an empty string if not applicable.
    object.type string The source object type for a display.
    object.typeId string The source object type identifier is the type reference key.
  • application/json: Finding type is “number”, or “integer” or “percentage”

    [
        {
            "type": "integer",
            "title": "Number of empty catch blocks",
            "findings": [
                {
                    "key": "378320",
                    "fileId": -2351,
                    "relativePath": "...",
                    "number": 1
                }
            ],
            "object": {
                "fullName": "org.compiere.process.AdempiereService.abort",
                "id": "378320",
                "mangling": "abort() return boolean",
                "name": "abort",
                "type": "Java Method",
                "typeId": "JV_METHOD"
            }
        },
        ...
    ]
    

    JSON Representation

    Property Type Description
    key string Internal key for traceability.
    title string The Finding title.
    type string The Finding type among ‘number’, ‘integer’, ‘percentage’.
    findings[] structure A finding is a number extracted from a source code.
    findings[].key string An internal finding key.
    findings[].fileId integer The source code file.
    findings[].relativePath string The source code relative file path.
    findings[].number number The finding as a number.
    object.id string The source object ID.
    object.name string The source object name.
    object.fullName string The source object long name, usually locates the object in a software architecture.
    object.mangling string The function signature or an empty string if not applicable.
    object.type string The source object type for a display.
    object.typeId string The source object type identifier is the type reference key.
  • application/json: Finding type is “object”

    [
        {
    
        "type": "object",
        "title": "...",
        "findings": [
            {
                "key": "26679",
                "fileId": -3882,
                "relativePath": "...",
                "fullName": "DEFAULT.M_PriceList_Create",
            }
        ],
        "object": {
          "fullName": "DEFAULT.AD_Column_Sync",
          "id": "6749",
          "mangling": "AD_Column_Sync()",
          "name": "AD_Column_Sync",
          "type": "Oracle Procedure",
          "typeId": "SQLScriptProcedure"
        },
    },
    ...
    

    ]

    JSON Representation

    Property Type Description
    key string Internal key for traceability.
    title string The Finding title.
    type string The Finding type. ‘object’ means the finding is a reference to another object.
    findings[] structure A finding is an object full name extracted from a source code.
    findings[].key string An internal finding key.
    findings[].fileId integer The source code file.
    findings[].relativePath string The source code relative file path.
    findings[].fullName string The finding as an object full name
    object.id string The source object ID.
    object.name string The source object name.
    object.fullName string The source object long name, usually locates the object in a software architecture.
    object.mangling string The function signature or an empty string if not applicable.
    object.type string The source object type for a display.
    object.typeId string The source object type identifier is the type reference key.
  • application/json: Finding type is “no-value”

    [
        {
    
        "type": "no-value",
        "title": "",
        "findings": [
            {
                "key": "6749",
                "fileId": -3882,
                "relativePath": "..."
            }
        ],
        "object": {
          "fullName": "DEFAULT.AD_Column_Sync",
          "id": "6749",
          "mangling": "AD_Column_Sync()",
          "name": "AD_Column_Sync",
          "type": "Oracle Procedure",
          "typeId": "SQLScriptProcedure"
        },
    },
    ...
    

    ]

    JSON Representation

    Property Type Description
    key string Internal key for traceability.
    title string Not applicable, this is an empty string.
    type string The Finding type. The finding is the object itself.
    findings[] structure A finding the object source code location.
    findings[].key string An internal finding key.
    findings[].fileId integer The source code file.
    findings[].relativePath string The source code relative file path.
    object.id string The source object ID.
    object.name string The source object name.
    object.fullName string The source object long name, usually locates the object in a software architecture.
    object.mangling string The function signature or an empty string if not applicable.
    object.type string The source object type for a display.
    object.typeId string The source object type identifier is the type reference key.