Passed
Push — master ( 345dac...c57047 )
by Mihail
09:15
created

Content::buildSitemapSchedule()   B

Complexity

Conditions 9
Paths 7

Size

Total Lines 52
Code Lines 30

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 30
dl 0
loc 52
rs 8.0555
c 0
b 0
f 0
cc 9
nc 7
nop 0

How to fix   Long Method   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php
2
3
namespace Apps\Controller\Front;
4
5
6
use Extend\Core\Arch\FrontAppController;
7
8
/**
9
 * Class Content. Controller of content app - content and categories.
10
 * @package Apps\Controller\Front
11
 */
12
class Content extends FrontAppController
13
{
14
    const TAG_PER_PAGE = 50;
15
16
    const EVENT_CONTENT_READ = 'content.read';
17
    const EVENT_RSS_READ = 'content.rss.read';
18
    const EVENT_CONTENT_LIST = 'content.list';
19
    const EVENT_TAG_LIST = 'content.tags';
20
21
    /**
22
     * Fatty action like actionList(), actionRead() are located in standalone traits.
23
     * This feature allow provide better read&write accessibility
24
     */
25
26
    use Content\ActionList {
27
        listing as actionList;
28
    }
29
30
    use Content\ActionRead {
31
        read as actionRead;
32
    }
33
34
    use Content\ActionUpdate {
35
        update as actionUpdate;
36
    }
37
38
    use Content\ActionTag {
39
        tag as actionTag;
40
    }
41
42
    use Content\ActionRss {
43
        rss as actionRss;
44
    }
45
46
    use Content\ActionMy {
47
        my as actionMy;
48
    }
49
50
    use Content\ActionComments {
0 ignored issues
show
Bug introduced by
The type Apps\Controller\Front\Content\ActionComments was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
51
        comments as actionComments;
52
    }
53
54
    use Content\ScheduledActions {
0 ignored issues
show
Bug introduced by
The type Apps\Controller\Front\Content\ScheduledActions was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
55
        sitemap as buildSitemapSchedule;
56
    }
57
}
58