Page MenuHomePhabricator

Identify and remove dead code
Open, LowPublicENHANCEMENT

Description

If we are rewriting things, we also need to know which things do not need rewrite because they are not used to begin with.

This includes:

  1. Command definitions that are inaccessible or hidden
  2. Scripts that are not referenced by other scripts or command definitions
  3. Modules that are not imported by any scripts
  4. Module functions that are not used anywhere

In this order I think.

Details

Difficulty level
Unknown (require assessment)
Version
-
Why the issue appeared?
Will be filled on close

Event Timeline

dmbaturin triaged this task as Low priority.May 31 2018, 4:16 AM
dmbaturin created this task.
dmbaturin created this object with visibility "Public (No Login Required)".

Completely dead:

/opt/vyatta/sbin/check-ipv4-ipv6.pl — apparently not referenced anywhere.
/opt/vyatta/sbin/check_tmpl — same.
/opt/vyatta/sbin/dump — what is that even?
/opt/vyatta/sbin/exe_action — same.
/opt/vyatta/sbin/test_uf — same.

/opt/vyatta/sbin/vyatta-find-type.pl — not referenced anywhere.
/opt/vyatta/sbin/vyatta-strip-migration-comments.pl — same.
/opt/vyatta/sbin/vyatta-output-config.pl — same.
/opt/vyatta/sbin/vyatta-regen-unpriv-commands.sh — same.
/opt/vyatta/sbin/vyatta-policy-action-verify.pl — same.

/opt/vyatta/bin/vyos-popcon.pl — an early attempt at popularity contest implementation, due for replacement anyway.

/opt/vyatta/bin/vtyshow.pl — appears unused.
/opt/vyatta/bin/vyatta-cpu-summary.pl — same.
/opt/vyatta/bin/sudo-users/quagga_gen_as_network.pl — same.

/opt/vyatta/bin/config-downgrade (and with it all config downgrade scripts) — never used and never really tested, abandoned at VC4.0 time.

Redundant and easy to replace:

/opt/vyatta/sbin/check_prefix_boundary — referenced by a few command template, candidate for replacement with ipaddrcheck-based validator.
/opt/vyatta/sbin/dhcpd.init — shouldn't we be using systemd for it now?
/opt/vyatta/sbin/dhcpdv6.init — same.
/opt/vyatta/sbin/dhcrelay-starter.pl — same.
/opt/vyatta/sbin/firewall.init — same.
/opt/vyatta/sbin/hostapd-init — same.

/opt/vyatta/sbin/if-mib-alias — used in a single script.

/opt/vyatta/sbin/telnetd.init — how do we go about telnet server in the end?

/opt/vyatta/sbin/valid_address — used by a few templates all in vyatta-cfg, easy to replace with ipaddrcheck.

/opt/vyatta/sbin/vyatta-cli-expand-var.pl — used by a single command.

/opt/vyatta/sbin/irq-affinity.pl — now that IRQ affinity of NICs is automated in the kernel, do we need to keep it?

/opt/vyatta/sbin/valid_address.pl — used by a single command.

/opt/vyatta/sbin/vyatta-validate-type and vyatta-validate-type.pl — duplicates of each other.

/opt/vyatta/bin/vyatta-sudo — used by three commands for unclear reasons.

dmbaturin moved this task from Need Triage to Wishlist on the VyOS 1.2 Crux board.Jun 3 2018, 3:44 AM
/opt/vyatta/bin/sudo-users/quagga_gen_as_network.pl

This script can be removed as soon as we will implement better way for populating AS numbers in netflow configuration.

https://phabricator.vyos.net/T732
https://github.com/vyos/vyatta-netflow/pull/3

After implementation of the patch it will be safe to remove references to
/etc/pmacct/networks.lst and script quagga_gen_as_network.pl

syncer changed the subtype of this task from "Task" to "Enhancement".Oct 20 2018, 4:49 AM
pasik added a subscriber: pasik.Mar 12 2019, 6:10 PM