FreeCAD/FreeCAD

TechDraw: QGIViewDimension unreadable technical debt (needs refactor)

Offen

#16.400 geöffnet am 09.09.2024

 (13 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)C++ (5.550 Forks)batch import
Help wantedMod: TechDrawStatus: Needs feedback

Repository-Metriken

Stars
 (30.913 Sterne)
PR-Merge-Metriken
 (Durchschn. Merge 24T 7h) (217 gemergte PRs in 30 T)

Beschreibung

Is there an existing issue for this?

  • I have searched the existing issues

Problem description

TechDrawGui::QGIViewDimension are 1200 lines long and unreadable. This makes changes (that I was trying to make) very difficult.

Here are two main issues: QGIViewDimension doesn't use object-oriented programming, it throws around 6-11 arguments for creating a dimension line, like member variables doesn't exist.

QGIViewDimension tries to be 10 different dimension types at once. This means that there are 10 different functions for each dimension types, completely independent of each other. There is no reason for having all this in a single object; it should really have been 10 different objects; that would significantly reduce the logic trying to differentiate the different types and improve readability only having related functions in the same file/object.

Full version info

-

Subproject(s) affected?

TechDraw

Anything else?

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Contributor Guide