Slide 1

Slide 1 text

PHP 2023 2023.06.24 Yuta Ohashi

Slide 2

Slide 2 text

/ @blue_goheimochi PHP(Laravel), JavaScript(Vue.js/Nuxt.js), , , , , PUBG Mobile,

Slide 3

Slide 3 text

Mission

Slide 4

Slide 4 text

/ @blue_goheimochi PHP(Laravel), JavaScript(Vue.js/Nuxt.js), , , , , PUBG Mobile,

Slide 5

Slide 5 text

/ @blue_goheimochi PHP(Laravel), JavaScript(Vue.js/Nuxt.js), , , , , PUBG Mobile, 6 24 ( ) PR

Slide 6

Slide 6 text

/ @blue_goheimochi PHP(Laravel), JavaScript(Vue.js/Nuxt.js), , , , , PUBG Mobile, 6 24 ( ) PR !! !!

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

8 • Notes on Programming in C • C 6 2 • • • • •

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

:

Slide 12

Slide 12 text

12 : • • • •

Slide 13

Slide 13 text

13 : • • • • • • etc...

Slide 14

Slide 14 text

14 : • : phpcpd • Copy/Paste Detector (CPD) for PHP code. • 2023 1 • • Don t Repeat Yourself •

Slide 15

Slide 15 text

15 : phpcpd 4.1.0 by Sebastian Bergmann. Found 184 clones with 9893 duplicated lines in 142 files: - /app/xxxxxx/xxxxxx/xxxxxx/xxxxxx.php:166-524 (358 lines) /app/xxxxxx/xxxxxx/xxxxxx/xxxxxx.php:170-528 ~~~~~~~~~~ - /app/xxxxxx/xxxxxx/xxxxxx/xxxxxx.php:321-561 (240 lines) /app/xxxxxx/xxxxxx/xxxxxx/xxxxxx.php:334-574 ~~~~~~~~~~~ - /app/xxxxxx/controllers/xxxxxx.php:909-1084 (175 lines) /app/xxxxxx/controllers/xxxxxx.php:1247-1422 ~~~~~~~~~~ 8.41% duplicated lines out of 112932 total lines of code. Average size of duplication is 54 lines, largest clone has 358 of lines 184 142 9,893

Slide 16

Slide 16 text

16 : phpcpd 4.1.0 by Sebastian Bergmann. Found 184 clones with 9893 duplicated lines in 142 files: - /app/xxxxxx/xxxxxx/xxxxxx/xxxxxx.php:166-524 (358 lines) /app/xxxxxx/xxxxxx/xxxxxx/xxxxxx.php:170-528 ~~~~~~~~~~ - /app/xxxxxx/xxxxxx/xxxxxx/xxxxxx.php:321-561 (240 lines) /app/xxxxxx/xxxxxx/xxxxxx/xxxxxx.php:334-574 ~~~~~~~~~~~ - /app/xxxxxx/controllers/xxxxxx.php:909-1084 (175 lines) /app/xxxxxx/controllers/xxxxxx.php:1247-1422 ~~~~~~~~~~ 8.41% duplicated lines out of 112932 total lines of code. Average size of duplication is 54 lines, largest clone has 358 of lines Fat

Slide 17

Slide 17 text

17 : phpcpd 4.1.0 by Sebastian Bergmann. Found 184 clones with 9893 duplicated lines in 142 files: - /app/xxxxxx/xxxxxx/xxxxxx/xxxxxx.php:166-524 (358 lines) /app/xxxxxx/xxxxxx/xxxxxx/xxxxxx.php:170-528 ~~~~~~~~~~ - /app/xxxxxx/xxxxxx/xxxxxx/xxxxxx.php:321-561 (240 lines) /app/xxxxxx/xxxxxx/xxxxxx/xxxxxx.php:334-574 ~~~~~~~~~~~ - /app/xxxxxx/controllers/xxxxxx.php:909-1084 (175 lines) /app/xxxxxx/controllers/xxxxxx.php:1247-1422 ~~~~~~~~~~ 8.41% duplicated lines out of 112932 total lines of code. Average size of duplication is 54 lines, largest clone has 358 of lines 112,932 8.41% 54 358

Slide 18

Slide 18 text

18 : • : 112,932 • : 8.41% • : 9,893 • : 184 • 規 : 142

Slide 19

Slide 19 text

19 : • : terryyin/lizard • Lizard is an extensible Cyclomatic Complexity Analyzer for many programming languages(PHP Python ) • • • if/else, for, switch •

Slide 20

Slide 20 text

20 : 10 25% 30 40% 50 70% 75 98%

Slide 21

Slide 21 text

21 : • : terryyin/lizard • Lizard is an extensible Cyclomatic Complexity Analyzer for many programming languages(PHP Python ) • • • if/else, for, switch • ========================================================================================= !!!! Warnings (cyclomatic_complexity > 15 or length > 1000 or parameter_count > 100) !!!! ================================================ NLOC CCN token PARAM length location ------------------------------------------------ 247 63 2436 0 353 aaaaAction@41-393@./xxxxx/controllers/zzzzController.php 139 41 1272 0 202 bbbbAction@625-826@./xxxxx/controllers/zzzzController.php 124 39 1018 0 161 ccccAction@77-237@./xxxxx/controllers/zzzzController.php 81 37 351 1 84 xxxx@840-923@./xxxx/xxxx/Controller/xxxx/Abstract.php 152 37 1086 0 197 xxxxAction@21-217@./xxxx/xxxx/xxxx/xxxxController.php 143 36 1110 0 197 xxxxAction@740-936@./xxxx/xxxx/xxxxController.php 150 35 1516 0 223 xxxxAction@33-255@./xxxx/controllers/xxxxController.php 63 34 741 1 72 xxxx@16-87@./xxxx/xxxx/xxxx/xxxx/xxxx/xxxx.php 81 34 917 0 106 aaaaAction@229-334@./yyyy/controllers/yyyyController.php 110 31 1071 0 143 xxxxAction@20-162@./xxxx/controllers/xxxxController.php 75 30 753 0 108 bbbb@79-186@./xxxx/controllers/yyyyController.php 97 29 926 0 127 ccccAction@609-735@./xxxx/controllers/yyyyController.php ========================================================================================== Total nloc Avg.NLOC AvgCCN Avg.token Fun Cnt Warning cnt Fun Rt nloc Rt ------------------------------------------------------------------------------------------ 33248 16.3 2.3 104.2 1743 11 0.01 0.05 63 70%

Slide 22

Slide 22 text

22 : • : terryyin/lizard • Lizard is an extensible Cyclomatic Complexity Analyzer for many programming languages(PHP Python ) • • • if/else, for, switch • ========================================================================================= !!!! Warnings (cyclomatic_complexity > 15 or length > 1000 or parameter_count > 100) !!!! ================================================ NLOC CCN token PARAM length location ------------------------------------------------ 247 63 2436 0 353 aaaaAction@41-393@./xxxxx/controllers/zzzzController.php 139 41 1272 0 202 bbbbAction@625-826@./xxxxx/controllers/zzzzController.php 124 39 1018 0 161 ccccAction@77-237@./xxxxx/controllers/zzzzController.php 81 37 351 1 84 xxxx@840-923@./xxxx/xxxx/Controller/xxxx/Abstract.php 152 37 1086 0 197 xxxxAction@21-217@./xxxx/xxxx/xxxx/xxxxController.php 143 36 1110 0 197 xxxxAction@740-936@./xxxx/xxxx/xxxxController.php 150 35 1516 0 223 xxxxAction@33-255@./xxxx/controllers/xxxxController.php 63 34 741 1 72 xxxx@16-87@./xxxx/xxxx/xxxx/xxxx/xxxx/xxxx.php 81 34 917 0 106 aaaaAction@229-334@./yyyy/controllers/yyyyController.php 110 31 1071 0 143 xxxxAction@20-162@./xxxx/controllers/xxxxController.php 75 30 753 0 108 bbbb@79-186@./xxxx/controllers/yyyyController.php 97 29 926 0 127 ccccAction@609-735@./xxxx/controllers/yyyyController.php ========================================================================================== Total nloc Avg.NLOC AvgCCN Avg.token Fun Cnt Warning cnt Fun Rt nloc Rt ------------------------------------------------------------------------------------------ 33248 16.3 2.3 104.2 1743 11 0.01 0.05 3

Slide 23

Slide 23 text

23 : • ( ): 69,946 • CCN: 2.8 • CCN • :4,518

Slide 24

Slide 24 text

24 : • : phpmd unusedcode • • • • •

Slide 25

Slide 25 text

25 : • : PHP CSFixer, PHP CodeSniffer • PSR-12 PSR-2 •

Slide 26

Slide 26 text

26 : • : PHPStan, Psalm • (= ) •

Slide 27

Slide 27 text

27 : • • • • • • etc...

Slide 28

Slide 28 text

28 : • • •

Slide 29

Slide 29 text

29 : • : Git • Git •

Slide 30

Slide 30 text

30 : • : Google Analytics • • •

Slide 31

Slide 31 text

31 : • : new relic, Datadog, Mackerel, Sentry • APM • • •

Slide 32

Slide 32 text

32 : PHPerKaigi 2023

Slide 33

Slide 33 text

33 : • • • • •

Slide 34

Slide 34 text

No content

Slide 35

Slide 35 text

:

Slide 36

Slide 36 text

36

Slide 37

Slide 37 text

37

Slide 38

Slide 38 text

38

Slide 39

Slide 39 text

39

Slide 40

Slide 40 text

40 : 4 4 • • • 4 •

Slide 41

Slide 41 text

41 : • • • • • etc...

Slide 42

Slide 42 text

42 : • : iPhone Apple Watch • • • • •

Slide 43

Slide 43 text

43 : • • • • • •

Slide 44

Slide 44 text

44 : 2 3 6 6 /km

Slide 45

Slide 45 text

45 : 2 3 6 6 /km 30

Slide 46

Slide 46 text

46 : • 5 • • • Zones iPhone • 211 (0.64 × ) =

Slide 47

Slide 47 text

47 : Zone %MAX 1 50 60% 94 112 2 60 70% 113 131 3 70 80% 132 150 4 80 90% 151 169 5 90 100% 170 188

Slide 48

Slide 48 text

48 : Zone 1 LSD 2 3 4 5

Slide 49

Slide 49 text

No content

Slide 50

Slide 50 text

No content

Slide 51

Slide 51 text

No content

Slide 52

Slide 52 text

No content

Slide 53

Slide 53 text

まとめ

Slide 54

Slide 54 text

54 • • • • • 2 •

Slide 55

Slide 55 text

Mission

Slide 56

Slide 56 text

No content