Skip to content

Refactor and Code Quality Cleanup for BESS Control Plane and Utilities #30

Description

@bhagathkrishnacdac

Issue/Feature Description:
This issue covers a comprehensive cleanup of technical debt across the bessctl, pybess, and bin/ directories. Key tasks include:

  • Refactoring: Simplifying functions with high nesting and complexity (notably in commands.py and cli.py) to improve readability.
  • Logic Fixes: Correcting unsafe floating-point equality checks and specifying caught exception types.
  • Code Cleanup: Removing unused function parameters, dead code, and commented-out blocks.
  • Optimization: Replacing duplicated string literals with defined constants.
  • Frontend Modernization: Updating JavaScript in the web interface from var to let/const and fixing scoping issues.

Why this issue to fixed / feature is needed(give scenarios or use cases):
The current state of several core files makes them difficult to maintain and test. High cognitive complexity in functions increases the risk of introducing bugs during updates. Additionally, using constants for repeated strings ensures consistency, while fixing logic smells (like generic exceptions and float comparisons) improves the overall reliability of the BESS control plane and DPDK utility scripts.

How to reproduce, in case of a bug:
These issues can be identified by performing a code audit or running static analysis/linting tools on the repository. Specific areas of concern include the deeply nested logic in bessctl/commands.py and the outdated variable declarations in bessctl/static/pipeline.js.

Other Notes / Environment Information: (Please give the env information, log link or any useful information for this issue)
NA

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