Completed
Pull Request — master (#200)
by Roberto
03:23
created

EvtDeslig   C

Complexity

Total Complexity 53

Size/Duplication

Total Lines 634
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 53
lcom 1
cbo 1
dl 0
loc 634
ccs 0
cts 593
cp 0
rs 6.926
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 1
F toNode() 0 592 52

How to fix   Complexity   

Complex Class

Complex classes like EvtDeslig often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes. You can also have a look at the cohesion graph to spot any un-connected, or weakly-connected components.

Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.

While breaking up the class, it is a good idea to analyze how other classes use EvtDeslig, and based on these observations, apply Extract Interface, too.

1
<?php
2
3
namespace NFePHP\eSocial\Factories;
4
5
/**
6
 * Class eSocial EvtDeslig Event S-2299 constructor
7
 * Read for 2.4.2 layout
8
 * Read for 2.5.0 layout
9
 *
10
 * @category  library
11
 * @package   NFePHP\eSocial
12
 * @copyright NFePHP Copyright (c) 2018
13
 * @license   http://www.gnu.org/licenses/lgpl.txt LGPLv3+
14
 * @license   https://opensource.org/licenses/MIT MIT
15
 * @license   http://www.gnu.org/licenses/gpl.txt GPLv3+
16
 * @author    Roberto L. Machado <linux.rlm at gmail dot com>
17
 * @link      http://github.com/nfephp-org/sped-esocial for the canonical source repository
18
 */
19
20
use NFePHP\Common\Certificate;
21
use NFePHP\eSocial\Common\Factory;
22
use NFePHP\eSocial\Common\FactoryId;
23
use NFePHP\eSocial\Common\FactoryInterface;
24
use stdClass;
25
26
class EvtDeslig extends Factory implements FactoryInterface
27
{
28
    /**
29
     * @var int
30
     */
31
    public $sequencial;
32
    /**
33
     * @var string
34
     */
35
    protected $evtName = 'evtDeslig';
36
    /**
37
     * @var string
38
     */
39
    protected $evtAlias = 'S-2299';
40
    /**
41
     * Parameters patterns
42
     *
43
     * @var array
44
     */
45
    protected $parameters = [];
46
47
    /**
48
     * Constructor
49
     *
50
     * @param string $config
51
     * @param stdClass $std
52
     * @param Certificate $certificate | null
53
     * @param string $date
54
     */
55
    public function __construct(
56
        $config,
57
        stdClass $std,
58
        Certificate $certificate = null,
59
        $date = ''
60
    ) {
61
        parent::__construct($config, $std, $certificate, $date);
62
    }
63
64
    /**
65
     * Node constructor
66
     */
67
    protected function toNode()
68
    {
69
        $ideEmpregador = $this->node->getElementsByTagName('ideEmpregador')->item(0);
70
        //o idEvento pode variar de evento para evento
71
        //então cada factory individualmente terá de construir o seu
72
        $ideEvento = $this->dom->createElement("ideEvento");
73
        $this->dom->addChild(
74
            $ideEvento,
75
            "indRetif",
76
            $this->std->indretif,
77
            true
78
        );
79
        $this->dom->addChild(
80
            $ideEvento,
81
            "nrRecibo",
82
            !empty($this->std->nrrecibo) ? $this->std->nrrecibo : null,
83
            false
84
        );
85
        $this->dom->addChild(
86
            $ideEvento,
87
            "tpAmb",
88
            $this->tpAmb,
89
            true
90
        );
91
        $this->dom->addChild(
92
            $ideEvento,
93
            "procEmi",
94
            $this->procEmi,
95
            true
96
        );
97
        $this->dom->addChild(
98
            $ideEvento,
99
            "verProc",
100
            $this->verProc,
101
            true
102
        );
103
        $this->node->insertBefore($ideEvento, $ideEmpregador);
104
        $ideVinculo = $this->dom->createElement("ideVinculo");
105
        $this->dom->addChild(
106
            $ideVinculo,
107
            "cpfTrab",
108
            $this->std->cpftrab,
109
            true
110
        );
111
        $this->dom->addChild(
112
            $ideVinculo,
113
            "nisTrab",
114
            $this->std->nistrab,
115
            true
116
        );
117
        $this->dom->addChild(
118
            $ideVinculo,
119
            "matricula",
120
            $this->std->matricula,
121
            true
122
        );
123
        $this->node->appendChild($ideVinculo);
124
        $infoDeslig = $this->dom->createElement("infoDeslig");
125
        $this->dom->addChild(
126
            $infoDeslig,
127
            "mtvDeslig",
128
            $this->std->mtvdeslig,
129
            true
130
        );
131
        $this->dom->addChild(
132
            $infoDeslig,
133
            "dtDeslig",
134
            $this->std->dtdeslig,
135
            true
136
        );
137
        $this->dom->addChild(
138
            $infoDeslig,
139
            "indPagtoAPI",
140
            $this->std->indpagtoapi,
141
            true
142
        );
143
        $this->dom->addChild(
144
            $infoDeslig,
145
            "dtProjFimAPI",
146
            !empty($this->std->dtprojfimapi) ? $this->std->dtprojfimapi : null,
147
            false
148
        );
149
        $this->dom->addChild(
150
            $infoDeslig,
151
            "pensAlim",
152
            $this->std->pensalim,
153
            true
154
        );
155
        $this->dom->addChild(
156
            $infoDeslig,
157
            "percAliment",
158
            !empty($this->std->percaliment) ? $this->std->percaliment : null,
159
            false
160
        );
161
        $this->dom->addChild(
162
            $infoDeslig,
163
            "vrAlim",
164
            !empty($this->std->vralim) ? $this->std->vralim : null,
165
            false
166
        );
167
        $this->dom->addChild(
168
            $infoDeslig,
169
            "nrCertObito",
170
            !empty($this->std->nrcertobito) ? $this->std->nrcertobito : null,
171
            false
172
        );
173
        $this->dom->addChild(
174
            $infoDeslig,
175
            "nrProcTrab",
176
            !empty($this->std->nrproctrab) ? $this->std->nrproctrab : null,
177
            false
178
        );
179
        $this->dom->addChild(
180
            $infoDeslig,
181
            "indCumprParc",
182
            $this->std->indcumprparc,
183
            true
184
        );
185
        $this->dom->addChild(
186
            $infoDeslig,
187
            "qtdDiasInterm",
188
            !empty($this->std->qtddiasinterm) ? $this->std->qtddiasinterm : null,
189
            false
190
        );
191
        if (!empty($this->std->observacoes)) {
192
            foreach ($this->std->observacoes as $obs) {
193
                $observacoes = $this->dom->createElement("observacoes");
194
                $this->dom->addChild(
195
                    $observacoes,
196
                    "observacao",
197
                    $obs->observacao,
198
                    false
199
                );
200
                $infoDeslig->appendChild($observacoes);
201
            }
202
        }
203
        if (!empty($this->std->sucessaovinc)) {
204
            $sucessaoVinc = $this->dom->createElement("sucessaoVinc");
205
            $this->dom->addChild(
206
                $sucessaoVinc,
207
                "tpInscSuc",
208
                !empty($this->std->sucessaovinc->tpinscsuc) ? $this->std->sucessaovinc->tpinscsuc : null,
209
                false
210
            );
211
            $this->dom->addChild(
212
                $sucessaoVinc,
213
                "cnpjSucessora",
214
                $this->std->sucessaovinc->cnpjsucessora,
215
                true
216
            );
217
            $infoDeslig->appendChild($sucessaoVinc);
218
        }
219
        if (!empty($this->std->transftit)) {
220
            $transfTit = $this->dom->createElement("transfTit");
221
            $this->dom->addChild(
222
                $transfTit,
223
                "cpfSubstituto",
224
                $this->std->transftit->cpfsubstituto,
225
                true
226
            );
227
            $this->dom->addChild(
228
                $transfTit,
229
                "dtNascto",
230
                $this->std->transftit->dtnascto,
231
                true
232
            );
233
            $infoDeslig->appendChild($transfTit);
234
        }
235
        if (!empty($this->std->mudancacpf)) {
236
            $mudancaCPF = $this->dom->createElement("mudancaCPF");
237
            $this->dom->addChild(
238
                $transfTit,
0 ignored issues
show
Bug introduced by
The variable $transfTit does not seem to be defined for all execution paths leading up to this point.

If you define a variable conditionally, it can happen that it is not defined for all execution paths.

Let’s take a look at an example:

function myFunction($a) {
    switch ($a) {
        case 'foo':
            $x = 1;
            break;

        case 'bar':
            $x = 2;
            break;
    }

    // $x is potentially undefined here.
    echo $x;
}

In the above example, the variable $x is defined if you pass “foo” or “bar” as argument for $a. However, since the switch statement has no default case statement, if you pass any other value, the variable $x would be undefined.

Available Fixes

  1. Check for existence of the variable explicitly:

    function myFunction($a) {
        switch ($a) {
            case 'foo':
                $x = 1;
                break;
    
            case 'bar':
                $x = 2;
                break;
        }
    
        if (isset($x)) { // Make sure it's always set.
            echo $x;
        }
    }
    
  2. Define a default value for the variable:

    function myFunction($a) {
        $x = ''; // Set a default which gets overridden for certain paths.
        switch ($a) {
            case 'foo':
                $x = 1;
                break;
    
            case 'bar':
                $x = 2;
                break;
        }
    
        echo $x;
    }
    
  3. Add a value for the missing path:

    function myFunction($a) {
        switch ($a) {
            case 'foo':
                $x = 1;
                break;
    
            case 'bar':
                $x = 2;
                break;
    
            // We add support for the missing case.
            default:
                $x = '';
                break;
        }
    
        echo $x;
    }
    
Loading history...
239
                "novoCPF",
240
                $this->std->mudancacpf->novocpf,
241
                true
242
            );
243
            $infoDeslig->appendChild($mudancaCPF);
244
        }
245
        
246
        if (!empty($this->std->verbasresc)) {
247
            $verbasResc = $this->dom->createElement("verbasResc");
248
            foreach ($this->std->verbasresc->dmdev as $dm) {
249
                $dmDev = $this->dom->createElement("dmDev");
250
                $this->dom->addChild(
251
                    $dmDev,
252
                    "ideDmDev",
253
                    $dm->idedmdev,
254
                    true
255
                );
256
                if (!empty($dm->infoperapur)) {
257
                    $infoPerApur = $this->dom->createElement("infoPerApur");
258
                    foreach ($dm->infoperapur->ideestablot as $isl) {
259
                        $ideEstabLot = $this->dom->createElement("ideEstabLot");
260
                        $this->dom->addChild(
261
                            $ideEstabLot,
262
                            "tpInsc",
263
                            $isl->tpinsc,
264
                            true
265
                        );
266
                        $this->dom->addChild(
267
                            $ideEstabLot,
268
                            "nrInsc",
269
                            $isl->nrinsc,
270
                            true
271
                        );
272
                        $this->dom->addChild(
273
                            $ideEstabLot,
274
                            "codLotacao",
275
                            $isl->codlotacao,
276
                            true
277
                        );
278
                        foreach ($isl->detverbas as $dv) {
279
                            $detVerbas = $this->dom->createElement("detVerbas");
280
                            $this->dom->addChild(
281
                                $detVerbas,
282
                                "codRubr",
283
                                $dv->codrubr,
284
                                true
285
                            );
286
                            $this->dom->addChild(
287
                                $detVerbas,
288
                                "ideTabRubr",
289
                                $dv->idetabrubr,
290
                                true
291
                            );
292
                            $this->dom->addChild(
293
                                $detVerbas,
294
                                "qtdRubr",
295
                                !empty($dv->qtdrubr) ? $dv->qtdrubr : null,
296
                                false
297
                            );
298
                            $this->dom->addChild(
299
                                $detVerbas,
300
                                "fatorRubr",
301
                                !empty($dv->fatorrubr) ? $dv->fatorrubr : null,
302
                                false
303
                            );
304
                            $this->dom->addChild(
305
                                $detVerbas,
306
                                "vrUnit",
307
                                !empty($dv->vrunit) ? $dv->vrunit : null,
308
                                false
309
                            );
310
                            $this->dom->addChild(
311
                                $detVerbas,
312
                                "vrRubr",
313
                                $dv->vrrubr,
314
                                true
315
                            );
316
                            $ideEstabLot->appendChild($detVerbas);
317
                        }
318
                        if (!empty($isl->infosaudecolet)) {
319
                            $infoSaudeColet = $this->dom->createElement("infoSaudeColet");
320
                            foreach ($isl->infosaudecolet->detoper as $do) {
321
                                $detOper = $this->dom->createElement("detOper");
322
                                $this->dom->addChild(
323
                                    $detOper,
324
                                    "cnpjOper",
325
                                    $do->cnpjoper,
326
                                    true
327
                                );
328
                                $this->dom->addChild(
329
                                    $detOper,
330
                                    "regANS",
331
                                    $do->regans,
332
                                    true
333
                                );
334
                                $this->dom->addChild(
335
                                    $detOper,
336
                                    "vrPgTit",
337
                                    $do->vrpgtit,
338
                                    true
339
                                );
340
                                if (!empty($do->detplano)) {
341
                                    foreach ($do->detplano as $dp) {
342
                                        $detPlano = $this->dom->createElement("detPlano");
343
                                        $this->dom->addChild(
344
                                            $detPlano,
345
                                            "tpDep",
346
                                            $dp->tpdep,
347
                                            true
348
                                        );
349
                                        $this->dom->addChild(
350
                                            $detPlano,
351
                                            "cpfDep",
352
                                            !empty($dp->cpfdep) ? $dp->cpfdep : null,
353
                                            false
354
                                        );
355
                                        $this->dom->addChild(
356
                                            $detPlano,
357
                                            "nmDep",
358
                                            $dp->nmdep,
359
                                            true
360
                                        );
361
                                        $this->dom->addChild(
362
                                            $detPlano,
363
                                            "dtNascto",
364
                                            $dp->dtnascto,
365
                                            true
366
                                        );
367
                                        $this->dom->addChild(
368
                                            $detPlano,
369
                                            "vlrPgDep",
370
                                            $dp->vlrpgdep,
371
                                            true
372
                                        );
373
                                        $detOper->appendChild($detPlano);
374
                                    }
375
                                }
376
                                $infoSaudeColet->appendChild($detOper);
377
                            }
378
                            $ideEstabLot->appendChild($infoSaudeColet);
379
                        }
380
                        if (!empty($isl->infoagnocivo)) {
381
                            $infoAgNocivo = $this->dom->createElement("infoAgNocivo");
382
                            $this->dom->addChild(
383
                                $infoAgNocivo,
384
                                "grauExp",
385
                                $isl->infoagnocivo->grauexp,
386
                                true
387
                            );
388
                            $ideEstabLot->appendChild($infoAgNocivo);
389
                        }
390
                        if (!empty($isl->infosimples)) {
391
                            $infoSimples = $this->dom->createElement("infoSimples");
392
                            $this->dom->addChild(
393
                                $infoSimples,
394
                                "indSimples",
395
                                $isl->infosimples->indsimples,
396
                                true
397
                            );
398
                            $ideEstabLot->appendChild($infoSimples);
399
                        }
400
                        $infoPerApur->appendChild($ideEstabLot);
401
                    }
402
                    $dmDev->appendChild($infoPerApur);
403
                }
404
                if (!empty($dm->infoperant)) {
405
                    $infoPerAnt = $this->dom->createElement("infoPerAnt");
406
                    foreach ($dm->infoperant->ideadc as $adc) {
407
                        $ideADC = $this->dom->createElement("ideADC");
408
                        $this->dom->addChild(
409
                            $ideADC,
410
                            "dtAcConv",
411
                            $adc->dtacconv,
412
                            true
413
                        );
414
                        $this->dom->addChild(
415
                            $ideADC,
416
                            "tpAcConv",
417
                            $adc->tpacconv,
418
                            true
419
                        );
420
                        $this->dom->addChild(
421
                            $ideADC,
422
                            "compAcConv",
423
                            !empty($adc->compacconv) ? $adc->compacconv : null,
424
                            false
425
                        );
426
                        $this->dom->addChild(
427
                            $ideADC,
428
                            "dtEfAcConv",
429
                            !empty($adc->dtefacconv) ? $adc->dtefacconv : null,
430
                            false
431
                        );
432
                        $this->dom->addChild(
433
                            $ideADC,
434
                            "dsc",
435
                            $adc->dsc,
436
                            true
437
                        );
438
                        foreach ($adc->ideperiodo as $aper) {
439
                            $idePeriodo = $this->dom->createElement("idePeriodo");
440
                            $this->dom->addChild(
441
                                $idePeriodo,
442
                                "perRef",
443
                                $aper->perref,
444
                                true
445
                            );
446
                            foreach ($aper->ideestablot as $ael) {
447
                                $dmideEstabLot = $this->dom->createElement("ideEstabLot");
448
                                $this->dom->addChild(
449
                                    $dmideEstabLot,
450
                                    "tpInsc",
451
                                    $ael->tpinsc,
452
                                    true
453
                                );
454
                                $this->dom->addChild(
455
                                    $dmideEstabLot,
456
                                    "nrInsc",
457
                                    $ael->nrinsc,
458
                                    true
459
                                );
460
                                $this->dom->addChild(
461
                                    $dmideEstabLot,
462
                                    "codLotacao",
463
                                    $ael->codlotacao,
464
                                    true
465
                                );
466
                                foreach ($ael->detverbas as $adv) {
467
                                    $dmdetVerbas = $this->dom->createElement("detVerbas");
468
                                    $this->dom->addChild(
469
                                        $dmdetVerbas,
470
                                        "codRubr",
471
                                        $adv->codrubr,
472
                                        true
473
                                    );
474
                                    $this->dom->addChild(
475
                                        $dmdetVerbas,
476
                                        "ideTabRubr",
477
                                        $adv->idetabrubr,
478
                                        true
479
                                    );
480
                                    $this->dom->addChild(
481
                                        $dmdetVerbas,
482
                                        "qtdRubr",
483
                                        !empty($adv->qtdrubr) ? $adv->qtdrubr : null,
484
                                        false
485
                                    );
486
                                    $this->dom->addChild(
487
                                        $dmdetVerbas,
488
                                        "fatorRubr",
489
                                        !empty($adv->fatorrubr) ? $adv->fatorrubr : null,
490
                                        false
491
                                    );
492
                                    $this->dom->addChild(
493
                                        $dmdetVerbas,
494
                                        "vrUnit",
495
                                        !empty($adv->vrunit) ? $adv->vrunit : null,
496
                                        false
497
                                    );
498
                                    $this->dom->addChild(
499
                                        $dmdetVerbas,
500
                                        "vrRubr",
501
                                        $adv->vrrubr,
502
                                        true
503
                                    );
504
                                    $dmideEstabLot->appendChild($dmdetVerbas);
505
                                }
506
                                if (!empty($ael->infoagnocivo)) {
507
                                    $infoAgNocivo = $this->dom->createElement("infoAgNocivo");
508
                                    $this->dom->addChild(
509
                                        $infoAgNocivo,
510
                                        "grauExp",
511
                                        $ael->infoagnocivo->grauexp,
512
                                        true
513
                                    );
514
                                    $dmideEstabLot->appendChild($infoAgNocivo);
515
                                }
516
                                if (!empty($ael->infosimples)) {
517
                                    $infoSimples = $this->dom->createElement("infoSimples");
518
                                    $this->dom->addChild(
519
                                        $infoSimples,
520
                                        "indSimples",
521
                                        $ael->infosimples->indsimples,
522
                                        true
523
                                    );
524
                                    $dmideEstabLot->appendChild($infoSimples);
525
                                }
526
                                $idePeriodo->appendChild($dmideEstabLot);
527
                            }
528
                            $ideADC->appendChild($idePeriodo);
529
                        }
530
                        $infoPerAnt->appendChild($ideADC);
531
                    }
532
                    $dmDev->appendChild($infoPerAnt);
533
                }
534
                if (!empty($dm->infotrabinterm)) {
535
                    foreach ($dm->infotrabinterm as $tin) {
536
                        $infoTrabInterm = $this->dom->createElement("infoTrabInterm");
537
                        $this->dom->addChild(
538
                            $infoTrabInterm,
539
                            "codConv",
540
                            $tin->codconv,
541
                            true
542
                        );
543
                        $dmDev->appendChild($infoTrabInterm);
544
                    }
545
                }
546
                $verbasResc->appendChild($dmDev);
547
            }
548
            if (!empty($this->std->verbasresc->procjudtrab)) {
549
                foreach ($this->std->verbasresc->procjudtrab as $pjt) {
550
                    $procJudTrab = $this->dom->createElement("procJudTrab");
551
                    $this->dom->addChild(
552
                        $procJudTrab,
553
                        "tpTrib",
554
                        $pjt->tptrib,
555
                        true
556
                    );
557
                    $this->dom->addChild(
558
                        $procJudTrab,
559
                        "nrProcJud",
560
                        $pjt->nrprocjud,
561
                        true
562
                    );
563
                    $this->dom->addChild(
564
                        $procJudTrab,
565
                        "codSusp",
566
                        !empty($pjt->codsusp) ? $pjt->codsusp : null,
567
                        false
568
                    );
569
                    $verbasResc->appendChild($procJudTrab);
570
                }
571
            }
572
            if (!empty($this->std->verbasresc->infomv)) {
573
                $imv = $this->std->verbasresc->infomv;
574
                $infoMV = $this->dom->createElement("infoMV");
575
                $this->dom->addChild(
576
                    $infoMV,
577
                    "indMV",
578
                    $imv->indmv,
579
                    true
580
                );
581
                foreach ($imv->remunoutrempr as $roe) {
582
                    $remunOutrEmpr = $this->dom->createElement("remunOutrEmpr");
583
                    $this->dom->addChild(
584
                        $remunOutrEmpr,
585
                        "tpInsc",
586
                        $roe->tpinsc,
587
                        true
588
                    );
589
                    $this->dom->addChild(
590
                        $remunOutrEmpr,
591
                        "nrInsc",
592
                        $roe->nrinsc,
593
                        true
594
                    );
595
                    $this->dom->addChild(
596
                        $remunOutrEmpr,
597
                        "codCateg",
598
                        $roe->codcateg,
599
                        true
600
                    );
601
                    $this->dom->addChild(
602
                        $remunOutrEmpr,
603
                        "vlrRemunOE",
604
                        $roe->vlrremunoe,
605
                        true
606
                    );
607
                    $infoMV->appendChild($remunOutrEmpr);
608
                }
609
                $verbasResc->appendChild($infoMV);
610
            }
611
            if (!empty($this->std->verbasresc->proccs)) {
612
                $procCS = $this->dom->createElement("procCS");
613
                $this->dom->addChild(
614
                    $procCS,
615
                    "nrProcJud",
616
                    $this->std->verbasresc->proccs->nrprocjud,
617
                    true
618
                );
619
                $verbasResc->appendChild($procCS);
620
            }
621
            $infoDeslig->appendChild($verbasResc);
622
        }
623
        if (!empty($this->std->quarentena)) {
624
            $quarentena = $this->dom->createElement("quarentena");
625
            $this->dom->addChild(
626
                $quarentena,
627
                "dtFimQuar",
628
                $this->std->quarentena->dtfimquar,
629
                true
630
            );
631
            $infoDeslig->appendChild($quarentena);
632
        }
633
        
634
        if (!empty($this->std->consigfgts)) {
635
            foreach ($this->std->consigfgts as $cfg) {
636
                $consigFGTS = $this->dom->createElement("consigFGTS");
637
                $this->dom->addChild(
638
                    $consigFGTS,
639
                    "insConsig",
640
                    $cfg->insconsig,
641
                    true
642
                );
643
                $this->dom->addChild(
644
                    $consigFGTS,
645
                    "nrContr",
646
                    $cfg->nrcontr,
647
                    true
648
                );
649
                $infoDeslig->appendChild($consigFGTS);
650
            }
651
        }
652
        
653
        $this->node->appendChild($infoDeslig);
654
        //finalização do xml
655
        $this->eSocial->appendChild($this->node);
656
        $this->xml = $this->dom->saveXML($this->eSocial);
657
        //$this->sign();
0 ignored issues
show
Unused Code Comprehensibility introduced by
84% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
658
    }
659
}
660