Test Setup Failed
Branch master (be722e)
by Yannick
75:49 queued 20:48
created

CWiki   C

Complexity

Total Complexity 54

Size/Duplication

Total Lines 821
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 821
rs 5.2173
c 0
b 0
f 0
wmc 54
lcom 0
cbo 0

54 Methods

Rating   Name   Duplication   Size   Complexity  
A setPageId() 0 6 1
A getPageId() 0 4 1
A setReflink() 0 6 1
A getReflink() 0 4 1
A setTitle() 0 6 1
A getTitle() 0 4 1
A setContent() 0 6 1
A getContent() 0 4 1
A setUserId() 0 6 1
A getUserId() 0 4 1
A setGroupId() 0 6 1
A getGroupId() 0 4 1
A setDtime() 0 6 1
A getDtime() 0 4 1
A setAddlock() 0 6 1
A getAddlock() 0 4 1
A setEditlock() 0 6 1
A getEditlock() 0 4 1
A setVisibility() 0 6 1
A getVisibility() 0 4 1
A setAddlockDisc() 0 6 1
A getAddlockDisc() 0 4 1
A setVisibilityDisc() 0 6 1
A getVisibilityDisc() 0 4 1
A setRatinglockDisc() 0 6 1
A getRatinglockDisc() 0 4 1
A setAssignment() 0 6 1
A getAssignment() 0 4 1
A setComment() 0 6 1
A getComment() 0 4 1
A setProgress() 0 6 1
A getProgress() 0 4 1
A setScore() 0 6 1
A getScore() 0 4 1
A setVersion() 0 6 1
A getVersion() 0 4 1
A setIsEditing() 0 6 1
A getIsEditing() 0 4 1
A setTimeEdit() 0 6 1
A getTimeEdit() 0 4 1
A setHits() 0 6 1
A getHits() 0 4 1
A setLinksto() 0 6 1
A getLinksto() 0 4 1
A setTag() 0 6 1
A getTag() 0 4 1
A setUserIp() 0 6 1
A getUserIp() 0 4 1
A setSessionId() 0 6 1
A getSessionId() 0 4 1
A setId() 0 6 1
A getId() 0 4 1
A setCId() 0 6 1
A getCId() 0 4 1

How to fix   Complexity   

Complex Class

Complex classes like CWiki 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 CWiki, and based on these observations, apply Extract Interface, too.

1
<?php
2
/* For licensing terms, see /license.txt */
3
4
namespace Chamilo\CourseBundle\Entity;
5
6
use Doctrine\ORM\Mapping as ORM;
7
8
/**
9
 * CWiki
10
 *
11
 * @ORM\Table(
12
 *  name="c_wiki",
13
 *  indexes={
14
 *      @ORM\Index(name="course", columns={"c_id"}),
15
 *      @ORM\Index(name="reflink", columns={"reflink"}),
16
 *      @ORM\Index(name="group_id", columns={"group_id"}),
17
 *      @ORM\Index(name="page_id", columns={"page_id"}),
18
 *      @ORM\Index(name="session_id", columns={"session_id"})
19
 *  }
20
 * )
21
 * @ORM\Entity
22
 */
23
class CWiki
24
{
25
    /**
26
     * @var integer
27
     *
28
     * @ORM\Column(name="iid", type="integer")
29
     * @ORM\Id
30
     * @ORM\GeneratedValue
31
     */
32
    private $iid;
0 ignored issues
show
Unused Code introduced by
The property $iid is not used and could be removed.

This check marks private properties in classes that are never used. Those properties can be removed.

Loading history...
33
34
    /**
35
     * @var integer
36
     *
37
     * @ORM\Column(name="c_id", type="integer")
38
     */
39
    private $cId;
40
41
    /**
42
     * @var integer
43
     *
44
     * @ORM\Column(name="id", type="integer", nullable=true)
45
     */
46
    private $id;
47
48
    /**
49
     * @var integer
50
     *
51
     * @ORM\Column(name="page_id", type="integer", nullable=true)
52
     */
53
    private $pageId;
54
55
    /**
56
     * @var string
57
     *
58
     * @ORM\Column(name="reflink", type="string", length=255, nullable=false)
59
     */
60
    private $reflink;
61
62
    /**
63
     * @var string
64
     *
65
     * @ORM\Column(name="title", type="string", length=255, nullable=false)
66
     */
67
    private $title;
68
69
    /**
70
     * @var string
71
     *
72
     * @ORM\Column(name="content", type="text", nullable=false)
73
     */
74
    private $content;
75
76
    /**
77
     * @var integer
78
     *
79
     * @ORM\Column(name="user_id", type="integer", nullable=false)
80
     */
81
    private $userId;
82
83
    /**
84
     * @var integer
85
     *
86
     * @ORM\Column(name="group_id", type="integer", nullable=true)
87
     */
88
    private $groupId;
89
90
    /**
91
     * @var \DateTime
92
     *
93
     * @ORM\Column(name="dtime", type="datetime", nullable=true)
94
     */
95
    private $dtime;
96
97
    /**
98
     * @var integer
99
     *
100
     * @ORM\Column(name="addlock", type="integer", nullable=false)
101
     */
102
    private $addlock;
103
104
    /**
105
     * @var integer
106
     *
107
     * @ORM\Column(name="editlock", type="integer", nullable=false)
108
     */
109
    private $editlock;
110
111
    /**
112
     * @var integer
113
     *
114
     * @ORM\Column(name="visibility", type="integer", nullable=false)
115
     */
116
    private $visibility;
117
118
    /**
119
     * @var integer
120
     *
121
     * @ORM\Column(name="addlock_disc", type="integer", nullable=false)
122
     */
123
    private $addlockDisc;
124
125
    /**
126
     * @var integer
127
     *
128
     * @ORM\Column(name="visibility_disc", type="integer", nullable=false)
129
     */
130
    private $visibilityDisc;
131
132
    /**
133
     * @var integer
134
     *
135
     * @ORM\Column(name="ratinglock_disc", type="integer", nullable=false)
136
     */
137
    private $ratinglockDisc;
138
139
    /**
140
     * @var integer
141
     *
142
     * @ORM\Column(name="assignment", type="integer", nullable=false)
143
     */
144
    private $assignment;
145
146
    /**
147
     * @var string
148
     *
149
     * @ORM\Column(name="comment", type="text", nullable=false)
150
     */
151
    private $comment;
152
153
    /**
154
     * @var string
155
     *
156
     * @ORM\Column(name="progress", type="text", nullable=false)
157
     */
158
    private $progress;
159
160
    /**
161
     * @var integer
162
     *
163
     * @ORM\Column(name="score", type="integer", nullable=true)
164
     */
165
    private $score;
166
167
    /**
168
     * @var integer
169
     *
170
     * @ORM\Column(name="version", type="integer", nullable=true)
171
     */
172
    private $version;
173
174
    /**
175
     * @var integer
176
     *
177
     * @ORM\Column(name="is_editing", type="integer", nullable=false)
178
     */
179
    private $isEditing;
180
181
    /**
182
     * @var \DateTime
183
     *
184
     * @ORM\Column(name="time_edit", type="datetime", nullable=true)
185
     */
186
    private $timeEdit;
187
188
    /**
189
     * @var integer
190
     *
191
     * @ORM\Column(name="hits", type="integer", nullable=true)
192
     */
193
    private $hits;
194
195
    /**
196
     * @var string
197
     *
198
     * @ORM\Column(name="linksto", type="text", nullable=false)
199
     */
200
    private $linksto;
201
202
    /**
203
     * @var string
204
     *
205
     * @ORM\Column(name="tag", type="text", nullable=false)
206
     */
207
    private $tag;
208
209
    /**
210
     * @var string
211
     *
212
     * @ORM\Column(name="user_ip", type="string", length=39, nullable=false)
213
     */
214
    private $userIp;
215
216
    /**
217
     * @var integer
218
     *
219
     * @ORM\Column(name="session_id", type="integer", nullable=true)
220
     */
221
    private $sessionId;
222
223
    /**
224
     * Set pageId
225
     *
226
     * @param integer $pageId
227
     * @return CWiki
228
     */
229
    public function setPageId($pageId)
230
    {
231
        $this->pageId = $pageId;
232
233
        return $this;
234
    }
235
236
    /**
237
     * Get pageId
238
     *
239
     * @return integer
240
     */
241
    public function getPageId()
242
    {
243
        return $this->pageId;
244
    }
245
246
    /**
247
     * Set reflink
248
     *
249
     * @param string $reflink
250
     * @return CWiki
251
     */
252
    public function setReflink($reflink)
253
    {
254
        $this->reflink = $reflink;
255
256
        return $this;
257
    }
258
259
    /**
260
     * Get reflink
261
     *
262
     * @return string
263
     */
264
    public function getReflink()
265
    {
266
        return $this->reflink;
267
    }
268
269
    /**
270
     * Set title
271
     *
272
     * @param string $title
273
     * @return CWiki
274
     */
275
    public function setTitle($title)
276
    {
277
        $this->title = $title;
278
279
        return $this;
280
    }
281
282
    /**
283
     * Get title
284
     *
285
     * @return string
286
     */
287
    public function getTitle()
288
    {
289
        return $this->title;
290
    }
291
292
    /**
293
     * Set content
294
     *
295
     * @param string $content
296
     * @return CWiki
297
     */
298
    public function setContent($content)
299
    {
300
        $this->content = $content;
301
302
        return $this;
303
    }
304
305
    /**
306
     * Get content
307
     *
308
     * @return string
309
     */
310
    public function getContent()
311
    {
312
        return $this->content;
313
    }
314
315
    /**
316
     * Set userId
317
     *
318
     * @param integer $userId
319
     * @return CWiki
320
     */
321
    public function setUserId($userId)
322
    {
323
        $this->userId = $userId;
324
325
        return $this;
326
    }
327
328
    /**
329
     * Get userId
330
     *
331
     * @return integer
332
     */
333
    public function getUserId()
334
    {
335
        return $this->userId;
336
    }
337
338
    /**
339
     * Set groupId
340
     *
341
     * @param integer $groupId
342
     * @return CWiki
343
     */
344
    public function setGroupId($groupId)
345
    {
346
        $this->groupId = $groupId;
347
348
        return $this;
349
    }
350
351
    /**
352
     * Get groupId
353
     *
354
     * @return integer
355
     */
356
    public function getGroupId()
357
    {
358
        return $this->groupId;
359
    }
360
361
    /**
362
     * Set dtime
363
     *
364
     * @param \DateTime $dtime
365
     * @return CWiki
366
     */
367
    public function setDtime($dtime)
368
    {
369
        $this->dtime = $dtime;
370
371
        return $this;
372
    }
373
374
    /**
375
     * Get dtime
376
     *
377
     * @return \DateTime
378
     */
379
    public function getDtime()
380
    {
381
        return $this->dtime;
382
    }
383
384
    /**
385
     * Set addlock
386
     *
387
     * @param integer $addlock
388
     * @return CWiki
389
     */
390
    public function setAddlock($addlock)
391
    {
392
        $this->addlock = $addlock;
393
394
        return $this;
395
    }
396
397
    /**
398
     * Get addlock
399
     *
400
     * @return integer
401
     */
402
    public function getAddlock()
403
    {
404
        return $this->addlock;
405
    }
406
407
    /**
408
     * Set editlock
409
     *
410
     * @param integer $editlock
411
     * @return CWiki
412
     */
413
    public function setEditlock($editlock)
414
    {
415
        $this->editlock = $editlock;
416
417
        return $this;
418
    }
419
420
    /**
421
     * Get editlock
422
     *
423
     * @return integer
424
     */
425
    public function getEditlock()
426
    {
427
        return $this->editlock;
428
    }
429
430
    /**
431
     * Set visibility
432
     *
433
     * @param integer $visibility
434
     * @return CWiki
435
     */
436
    public function setVisibility($visibility)
437
    {
438
        $this->visibility = $visibility;
439
440
        return $this;
441
    }
442
443
    /**
444
     * Get visibility
445
     *
446
     * @return integer
447
     */
448
    public function getVisibility()
449
    {
450
        return $this->visibility;
451
    }
452
453
    /**
454
     * Set addlockDisc
455
     *
456
     * @param integer $addlockDisc
457
     * @return CWiki
458
     */
459
    public function setAddlockDisc($addlockDisc)
460
    {
461
        $this->addlockDisc = $addlockDisc;
462
463
        return $this;
464
    }
465
466
    /**
467
     * Get addlockDisc
468
     *
469
     * @return integer
470
     */
471
    public function getAddlockDisc()
472
    {
473
        return $this->addlockDisc;
474
    }
475
476
    /**
477
     * Set visibilityDisc
478
     *
479
     * @param integer $visibilityDisc
480
     * @return CWiki
481
     */
482
    public function setVisibilityDisc($visibilityDisc)
483
    {
484
        $this->visibilityDisc = $visibilityDisc;
485
486
        return $this;
487
    }
488
489
    /**
490
     * Get visibilityDisc
491
     *
492
     * @return integer
493
     */
494
    public function getVisibilityDisc()
495
    {
496
        return $this->visibilityDisc;
497
    }
498
499
    /**
500
     * Set ratinglockDisc
501
     *
502
     * @param integer $ratinglockDisc
503
     * @return CWiki
504
     */
505
    public function setRatinglockDisc($ratinglockDisc)
506
    {
507
        $this->ratinglockDisc = $ratinglockDisc;
508
509
        return $this;
510
    }
511
512
    /**
513
     * Get ratinglockDisc
514
     *
515
     * @return integer
516
     */
517
    public function getRatinglockDisc()
518
    {
519
        return $this->ratinglockDisc;
520
    }
521
522
    /**
523
     * Set assignment
524
     *
525
     * @param integer $assignment
526
     * @return CWiki
527
     */
528
    public function setAssignment($assignment)
529
    {
530
        $this->assignment = $assignment;
531
532
        return $this;
533
    }
534
535
    /**
536
     * Get assignment
537
     *
538
     * @return integer
539
     */
540
    public function getAssignment()
541
    {
542
        return $this->assignment;
543
    }
544
545
    /**
546
     * Set comment
547
     *
548
     * @param string $comment
549
     * @return CWiki
550
     */
551
    public function setComment($comment)
552
    {
553
        $this->comment = $comment;
554
555
        return $this;
556
    }
557
558
    /**
559
     * Get comment
560
     *
561
     * @return string
562
     */
563
    public function getComment()
564
    {
565
        return $this->comment;
566
    }
567
568
    /**
569
     * Set progress
570
     *
571
     * @param string $progress
572
     * @return CWiki
573
     */
574
    public function setProgress($progress)
575
    {
576
        $this->progress = $progress;
577
578
        return $this;
579
    }
580
581
    /**
582
     * Get progress
583
     *
584
     * @return string
585
     */
586
    public function getProgress()
587
    {
588
        return $this->progress;
589
    }
590
591
    /**
592
     * Set score
593
     *
594
     * @param integer $score
595
     * @return CWiki
596
     */
597
    public function setScore($score)
598
    {
599
        $this->score = $score;
600
601
        return $this;
602
    }
603
604
    /**
605
     * Get score
606
     *
607
     * @return integer
608
     */
609
    public function getScore()
610
    {
611
        return $this->score;
612
    }
613
614
    /**
615
     * Set version
616
     *
617
     * @param integer $version
618
     * @return CWiki
619
     */
620
    public function setVersion($version)
621
    {
622
        $this->version = $version;
623
624
        return $this;
625
    }
626
627
    /**
628
     * Get version
629
     *
630
     * @return integer
631
     */
632
    public function getVersion()
633
    {
634
        return $this->version;
635
    }
636
637
    /**
638
     * Set isEditing
639
     *
640
     * @param integer $isEditing
641
     * @return CWiki
642
     */
643
    public function setIsEditing($isEditing)
644
    {
645
        $this->isEditing = $isEditing;
646
647
        return $this;
648
    }
649
650
    /**
651
     * Get isEditing
652
     *
653
     * @return integer
654
     */
655
    public function getIsEditing()
656
    {
657
        return $this->isEditing;
658
    }
659
660
    /**
661
     * Set timeEdit
662
     *
663
     * @param \DateTime $timeEdit
664
     * @return CWiki
665
     */
666
    public function setTimeEdit($timeEdit)
667
    {
668
        $this->timeEdit = $timeEdit;
669
670
        return $this;
671
    }
672
673
    /**
674
     * Get timeEdit
675
     *
676
     * @return \DateTime
677
     */
678
    public function getTimeEdit()
679
    {
680
        return $this->timeEdit;
681
    }
682
683
    /**
684
     * Set hits
685
     *
686
     * @param integer $hits
687
     * @return CWiki
688
     */
689
    public function setHits($hits)
690
    {
691
        $this->hits = $hits;
692
693
        return $this;
694
    }
695
696
    /**
697
     * Get hits
698
     *
699
     * @return integer
700
     */
701
    public function getHits()
702
    {
703
        return $this->hits;
704
    }
705
706
    /**
707
     * Set linksto
708
     *
709
     * @param string $linksto
710
     * @return CWiki
711
     */
712
    public function setLinksto($linksto)
713
    {
714
        $this->linksto = $linksto;
715
716
        return $this;
717
    }
718
719
    /**
720
     * Get linksto
721
     *
722
     * @return string
723
     */
724
    public function getLinksto()
725
    {
726
        return $this->linksto;
727
    }
728
729
    /**
730
     * Set tag
731
     *
732
     * @param string $tag
733
     * @return CWiki
734
     */
735
    public function setTag($tag)
736
    {
737
        $this->tag = $tag;
738
739
        return $this;
740
    }
741
742
    /**
743
     * Get tag
744
     *
745
     * @return string
746
     */
747
    public function getTag()
748
    {
749
        return $this->tag;
750
    }
751
752
    /**
753
     * Set userIp
754
     *
755
     * @param string $userIp
756
     * @return CWiki
757
     */
758
    public function setUserIp($userIp)
759
    {
760
        $this->userIp = $userIp;
761
762
        return $this;
763
    }
764
765
    /**
766
     * Get userIp
767
     *
768
     * @return string
769
     */
770
    public function getUserIp()
771
    {
772
        return $this->userIp;
773
    }
774
775
    /**
776
     * Set sessionId
777
     *
778
     * @param integer $sessionId
779
     * @return CWiki
780
     */
781
    public function setSessionId($sessionId)
782
    {
783
        $this->sessionId = $sessionId;
784
785
        return $this;
786
    }
787
788
    /**
789
     * Get sessionId
790
     *
791
     * @return integer
792
     */
793
    public function getSessionId()
794
    {
795
        return $this->sessionId;
796
    }
797
798
    /**
799
     * Set id
800
     *
801
     * @param integer $id
802
     * @return CWiki
803
     */
804
    public function setId($id)
805
    {
806
        $this->id = $id;
807
808
        return $this;
809
    }
810
811
    /**
812
     * Get id
813
     *
814
     * @return integer
815
     */
816
    public function getId()
817
    {
818
        return $this->id;
819
    }
820
821
    /**
822
     * Set cId
823
     *
824
     * @param integer $cId
825
     * @return CWiki
826
     */
827
    public function setCId($cId)
828
    {
829
        $this->cId = $cId;
830
831
        return $this;
832
    }
833
834
    /**
835
     * Get cId
836
     *
837
     * @return integer
838
     */
839
    public function getCId()
840
    {
841
        return $this->cId;
842
    }
843
}
844