Line layer → length_m per feature, cable length with slack %, summary per category field. Run it from the GIS workbench Toolbox (category “Sample plugins”). Source: plugin.js (pure maths, no libraries) and manifest.json — copy them to start your own plugin.