Too many phpmd warnings
Vaduz opened this issue · 2 comments
Vaduz commented
Bug Report
Too many phpmd
warnings. We need to check below.
Describe the bug
examples/EchoBot/src/LINEBot/EchoBot/Dependency.php:32 Missing class import via use statement (line '32', column '27').
examples/EchoBot/src/LINEBot/EchoBot/Dependency.php:33 Missing class import via use statement (line '33', column '40').
examples/EchoBot/src/LINEBot/EchoBot/Dependency.php:34 Missing class import via use statement (line '34', column '38').
examples/KitchenSink/src/LINEBot/KitchenSink/Dependency.php:32 Missing class import via use statement (line '32', column '27').
examples/KitchenSink/src/LINEBot/KitchenSink/Dependency.php:33 Missing class import via use statement (line '33', column '40').
examples/KitchenSink/src/LINEBot/KitchenSink/Dependency.php:34 Missing class import via use statement (line '34', column '38').
src/LINEBot.php:42 The class LINEBot has 1169 lines of code. Current threshold is 1000. Avoid really long classes.
src/LINEBot.php:42 The class LINEBot has 70 public methods and attributes. Consider reducing the number of public items to less than 45.
src/LINEBot.php:42 The class LINEBot has 36 non-getter- and setter-methods. Consider refactoring LINEBot to keep number of methods under 25.
src/LINEBot.php:42 The class LINEBot has an overall complexity of 97 which is very high. The configured complexity threshold is 50.
src/LINEBot.php:42 The class LINEBot has a coupling between objects value of 15. Consider to reduce the number of dependencies under 13.
src/LINEBot.php:188 The method pushMessage has a boolean flag argument $notificationDisabled, which is a certain sign of a Single Responsibility Principle violation.
src/LINEBot.php:213 The method multicast has a boolean flag argument $notificationDisabled, which is a certain sign of a Single Responsibility Principle violation.
src/LINEBot.php:236 The method broadcast has a boolean flag argument $notificationDisabled, which is a certain sign of a Single Responsibility Principle violation.
src/LINEBot.php:280 The method parseEventRequest has a boolean flag argument $eventOnly, which is a certain sign of a Single Responsibility Principle violation.
src/LINEBot.php:887 The method sendNarrowcast has a boolean flag argument $upToRemainingQuota, which is a certain sign of a Single Responsibility Principle violation.
src/LINEBot.php:938 The method createAudienceGroupForUploadingUserIds has a boolean flag argument $isIfaAudience, which is a certain sign of a Single Responsibility Principle violation.
src/LINEBot.php:966 The method createAudienceGroupForUploadingUserIdsByFile has a boolean flag argument $isIfaAudience, which is a certain sign of a Single Responsibility Principle violation.
src/LINEBot/Event/Parser/EventRequestParser.php:64 The method parseEventRequest has a boolean flag argument $eventsOnly, which is a certain sign of a Single Responsibility Principle violation.
src/LINEBot/HTTPClient/CurlHTTPClient.php:119 The method getOptions() has a Cyclomatic Complexity of 11. The configured cyclomatic complexity threshold is 10.
src/LINEBot/MessageBuilder/Flex/ComponentBuilder/BoxComponentBuilder.php:38 The class BoxComponentBuilder has 31 fields. Consider redesigning BoxComponentBuilder to keep the number of fields under 15.
src/LINEBot/MessageBuilder/Flex/ComponentBuilder/ImageComponentBuilder.php:38 The class ImageComponentBuilder has 17 fields. Consider redesigning ImageComponentBuilder to keep the number of fields under 15.
src/LINEBot/MessageBuilder/Flex/ComponentBuilder/ImageComponentBuilder.php:346 The method setAnimated has a boolean flag argument $animated, which is a certain sign of a Single Responsibility Principle violation.
src/LINEBot/MessageBuilder/Flex/ComponentBuilder/TextComponentBuilder.php:40 The class TextComponentBuilder has 21 fields. Consider redesigning TextComponentBuilder to keep the number of fields under 15.
src/LINEBot/MessageBuilder/Text/EmojiTextBuilder.php:45 Avoid unused parameters such as '$emojis'.
src/LINEBot/MessageBuilder/TextMessageBuilder.php:112 Avoid unused local variables such as '$message'.
src/LINEBot/Narrowcast/DemographicFilter/SubscriptionPeriodDemographicFilterBuilder.php:25 Avoid excessively long class names like SubscriptionPeriodDemographicFilterBuilder. Keep class name length under 40.
To Reproduce
$ make phpmd
Expected behavior
No outputs
Environment (please complete the following information):
- OS: Ubuntu
- PHP version 7.4.15
- line-bot-sdk-php version 6.2
tokuhirom commented
moririnson commented
thank you!