-
Notifications
You must be signed in to change notification settings - Fork 942
Comments
Conversation
THausherr
commented
Nov 19, 2023
This introduces a new public method in a class :-(
lehmi
commented
Nov 20, 2023
The parser is based in the lexer/parser principle. The lexer knows the lexical structure of the format and the parser itself uses the lexer to read an interpret the content of the files using the format. The Type1Font is the result of the parsing and doesn't need to know anything about the file format itself. According to that principle the moved methods end up in the wrong class. If we really want to change something, we might merge the lexer and the parser class, but in the moment I don't see any real reason to do so.
The implementation of readFontAttributes is, no offense, a no go. It is a wrapper for accessing the member values of the class. The huge switch statement would trigger our sonar scanner. A better approach is to introduce a setter for each value or an ever better solution is to introduce an additional class wrapping a couple of values which belong together, e.g. FontDirectory and FontInfo. Those classes could be used to initialize the Type1Font.
THausherr
commented
Nov 20, 2023
Sorry if I'm wrong, but I'm wondering whether this is a kind of public test of a new product on open source repositories to see how the humans involved react.
Move Method Refactoring
Reason: Feature Envy
Logic of Refactoring: