Skip to content

Unpinned Lizard: the image runs 1.24.3 (API says 1.24.0), which crashes on valid JavaScript fixed in 1.25.x #26

Done

Description

@GabrYelPalacios

Summary

The image installs Lizard unpinned (RUN pip install lizard in the Dockerfile), so the version that runs depends on when the image was built. On our repositories the results match Lizard 1.24.3 exactly, while the Codacy API reports the tool as 1.24.0. Lizard 1.24.3 also crashes on a valid JavaScript pattern that is fixed in 1.25.x. Because the image runs every file in a single call (lizard -V -f <list>), one such file leaves the whole repository without Lizard results.

Version identity

We measured the same commit with each Lizard release and compared against the findings Codacy reported for it, matching on function, CCN and NLOC:

Lizard matches Codacy's findings
1.24.0, 1.24.1 no: TSX functions are cut short
1.24.2 no: one function measures CCN 160 instead of 157
1.24.3 yes, all of them
1.25.1 no: different measurements

Crash (1.24.3)

rompe.js:

g(() => true, { a: b });
h(g(() => true, { a: b }));
$ pip install lizard==1.24.3 && lizard -V rompe.js; echo $?
  File ".../lizard_languages/javascript_bindings.py", line 34, in in_expression
    return self._frames[-1].initializing or bool(self._expression_brackets)
           ~~~~~~~~~~~~^^^^
IndexError: list index out of range
1

$ pip install lizard==1.25.1 && lizard -V rompe.js; echo $?
0

Request

  1. Pin Lizard in the Dockerfile (pip install lizard==<version>), so that the version the API reports is the one that runs.
  2. Rebuild the image with 1.25.1, the current release, which fixes the crash above.
  3. Optionally: when Lizard fails on one file, keep the results of the others instead of losing the whole run.

Activity

  1. DMarinhoCodacy commented on Nov 26, 2026

    @DMarinhoCodacy
    Contributor

    Hello @GabrYelPalacios
    Thanks for reaching out!
    You're right, I'm opening a PR to use a hardcoded version instead of the regular pip install lizard command.
    That way, the build will follow a known version instead of getting a version on the fly.
    Kind regards,
    David

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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