Skip to content

Using --number with lines greater than 3 does not change context #25

@ericwb

Description

@ericwb

Using --number with lines less than 3 will correctly trim output. For example:

bandit -r --number 1 glances/glances/

Issue: Try, Except, Pass detected.
Severity: Low Confidence: High
Location: glances/glances/plugins/glances_sensors.py:26
26 except ImportError:

Issue: Try, Except, Pass detected.
Severity: Low Confidence: High
Location: glances/glances/plugins/glances_uptime.py:76
76 except Exception:

However, using --number greater than 3 does not adjust the output. It still uses only 3 lines maximum.

bandit -r --number 10 glances/glances/

Issue: Try, Except, Pass detected.
Severity: Low Confidence: High
Location: glances/glances/plugins/glances_uptime.py:76
75 self.stats = str(timedelta(seconds=int(uptime) / 100))
76 except Exception:
77 pass

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