Completed
Push — master ( cd0f1c...b7e79d )
by Michael
03:34
created

__TwigTemplate_e51cc397ba0a43944b0e8928aca8497177a67ece595d0f5a46355a16ab788be2   A

Complexity

Total Complexity 10

Size/Duplication

Total Lines 71
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 10
c 1
b 0
f 1
lcom 0
cbo 0
dl 71
loc 71
rs 10

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php
2
3
/* classes.twig */
4
class __TwigTemplate_e51cc397ba0a43944b0e8928aca8497177a67ece595d0f5a46355a16ab788be2 extends Twig_Template
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
Coding Style introduced by
This class is not in CamelCase format.

Classes in PHP are usually named in CamelCase.

In camelCase names are written without any punctuation, the start of each new word being marked by a capital letter. The whole name starts with a capital letter as well.

Thus the name database provider becomes DatabaseProvider.

Loading history...
5
{
6
    public function __construct(Twig_Environment $env)
7
    {
8
        parent::__construct($env);
9
10
        // line 1
11
        $this->parent = $this->loadTemplate("layout/layout.twig", "classes.twig", 1);
12
        $this->blocks = array(
13
            'title' => array($this, 'block_title'),
14
            'body_class' => array($this, 'block_body_class'),
15
            'page_content' => array($this, 'block_page_content'),
16
        );
17
    }
18
19
    protected function doGetParent(array $context)
20
    {
21
        return "layout/layout.twig";
22
    }
23
24
    protected function doDisplay(array $context, array $blocks = array())
25
    {
26
        // line 2
27
        $context["__internal_1a1f1c9dbd6ccffd2e26a192ca58989cc87015a8e03625d5ac65767dfda27f41"] = $this->loadTemplate("macros.twig", "classes.twig", 2);
28
        // line 1
29
        $this->parent->display($context, array_merge($this->blocks, $blocks));
30
    }
31
32
    // line 3
33
    public function block_title($context, array $blocks = array())
0 ignored issues
show
Coding Style introduced by
This method is not in camel caps format.

This check looks for method names that are not written in camelCase.

In camelCase names are written without any punctuation, the start of each new word being marked by a capital letter. Thus the name database connection seeker becomes databaseConnectionSeeker.

Loading history...
34
    {
35
        echo "All Classes | ";
36
        $this->displayParentBlock("title", $context, $blocks);
37
    }
38
39
    // line 4
40
    public function block_body_class($context, array $blocks = array())
0 ignored issues
show
Coding Style introduced by
This method is not in camel caps format.

This check looks for method names that are not written in camelCase.

In camelCase names are written without any punctuation, the start of each new word being marked by a capital letter. Thus the name database connection seeker becomes databaseConnectionSeeker.

Loading history...
41
    {
42
        echo "classes";
43
    }
44
45
    // line 6
46
    public function block_page_content($context, array $blocks = array())
0 ignored issues
show
Coding Style introduced by
This method is not in camel caps format.

This check looks for method names that are not written in camelCase.

In camelCase names are written without any punctuation, the start of each new word being marked by a capital letter. Thus the name database connection seeker becomes databaseConnectionSeeker.

Loading history...
47
    {
48
        // line 7
49
        echo "    <div class=\"page-header\">
50
        <h1>Classes</h1>
51
    </div>
52
53
    ";
54
        // line 11
55
        echo $context["__internal_1a1f1c9dbd6ccffd2e26a192ca58989cc87015a8e03625d5ac65767dfda27f41"]->getrender_classes((isset($context["classes"]) ? $context["classes"] : $this->getContext($context, "classes")));
56
        echo "
57
";
58
    }
59
60
    public function getTemplateName()
61
    {
62
        return "classes.twig";
63
    }
64
65
    public function isTraitable()
66
    {
67
        return false;
68
    }
69
70
    public function getDebugInfo()
71
    {
72
        return array (  55 => 11,  49 => 7,  46 => 6,  40 => 4,  33 => 3,  29 => 1,  27 => 2,  11 => 1,);
73
    }
74
}
75
/* {% extends "layout/layout.twig" %}*/
0 ignored issues
show
Unused Code Comprehensibility introduced by
40% 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...
76
/* {% from "macros.twig" import render_classes %}*/
77
/* {% block title %}All Classes | {{ parent() }}{% endblock %}*/
0 ignored issues
show
Unused Code Comprehensibility introduced by
38% 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...
78
/* {% block body_class 'classes' %}*/
79
/* */
80
/* {% block page_content %}*/
81
/*     <div class="page-header">*/
82
/*         <h1>Classes</h1>*/
83
/*     </div>*/
84
/* */
85
/*     {{ render_classes(classes) }}*/
0 ignored issues
show
Unused Code Comprehensibility introduced by
55% 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...
86
/* {% endblock %}*/
87
/* */
88