Skip to content

Occurrence line numbers are off #1670

@nscuro

Description

@nscuro

Running cdxgen with research profile on the hyades-apiserver repository yields occurrences with incorrect line numbers.

git clone https://github.com/DependencyTrack/hyades-apiserver.git cdxgen-hyades-apiserver
cd cdxgen-hyades-apiserver

# For reproducability. This is the latest commit as of creation of this issue.
git reset --hard cf2744a829bf97d61fe42c80a019d52e5fb56098

docker run --rm \
  -e CDXGEN_DEBUG_MODE=debug \
  -v /tmp:/tmp \
  -v $(pwd):/app:rw \
  --pull always \
  -t ghcr.io/cyclonedx/cdxgen:master \
  -o /app/bom.json -t java --profile research . -p

jq '.' bom.json > bom-formatted.json

Result: bom-formatted.json

For the component alpine-common, the first 3 occurrences listed are:

{
  "location": "src/main/java/org/dependencytrack/auth/Permissions.java#36"
},
{
  "location": "src/main/java/org/dependencytrack/common/ClusterInfo.java#91"
},
{
  "location": "src/main/java/org/dependencytrack/common/HttpClientPool.java#200"
}

Perhaps there is some sort of offset which is miscalculated?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions