Completed
Branch master (cd0f1c)
by Michael
03:21
created

__TwigTemplate_2fd5b29735c4f46f3af0c10dcdaafd7c8d11fecbb69d734eb926970e7db230b1   A

Complexity

Total Complexity 22

Size/Duplication

Total Lines 179
Duplicated Lines 3.91 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

11 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 15 1
C doDisplay() 7 66 10
A block_title() 0 4 2
B block_head() 0 35 1
A block_html() 0 17 2
A block_body_class() 0 4 1
A block_page_id() 0 4 1
A block_content() 0 4 1
A getTemplateName() 0 4 1
A isTraitable() 0 4 1
A getDebugInfo() 0 4 1

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
/* layout/base.twig */
4
class __TwigTemplate_2fd5b29735c4f46f3af0c10dcdaafd7c8d11fecbb69d734eb926970e7db230b1 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
        $this->parent = false;
11
12
        $this->blocks = array(
13
            'title' => array($this, 'block_title'),
14
            'head' => array($this, 'block_head'),
15
            'html' => array($this, 'block_html'),
16
            'body_class' => array($this, 'block_body_class'),
17
            'page_id' => array($this, 'block_page_id'),
18
            'content' => array($this, 'block_content'),
19
        );
20
    }
21
22
    protected function doDisplay(array $context, array $blocks = array())
23
    {
24
        // line 1
25
        echo "<!DOCTYPE html>
26
<html lang=\"en\">
27
<head>
28
    <meta charset=\"UTF-8\" />
29
    <meta name=\"robots\" content=\"index, follow, all\" />
30
    <title>";
31
        // line 6
32
        $this->displayBlock('title', $context, $blocks);
33
        echo "</title>
34
35
    ";
36
        // line 8
37
        $this->displayBlock('head', $context, $blocks);
38
        // line 20
39
        echo "
40
    ";
41
        // line 21
42 View Code Duplication
        if ($this->getAttribute((isset($context["project"]) ? $context["project"] : $this->getContext($context, "project")), "config", array(0 => "favicon"), "method")) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
43
            // line 22
44
            echo "        <link rel=\"shortcut icon\" href=\"";
45
            echo twig_escape_filter($this->env, $this->getAttribute((isset($context["project"]) ? $context["project"] : $this->getContext($context, "project")), "config", array(0 => "favicon"), "method"), "html", null, true);
46
            echo "\" />
47
    ";
48
        }
49
        // line 24
50
        echo "
51
    ";
52
        // line 25
53
        if ($this->getAttribute((isset($context["project"]) ? $context["project"] : $this->getContext($context, "project")), "config", array(0 => "base_url"), "method")) {
54
            // line 26
55
            $context['_parent'] = $context;
56
            $context['_seq'] = twig_ensure_traversable($this->getAttribute((isset($context["project"]) ? $context["project"] : $this->getContext($context, "project")), "versions", array()));
57
            foreach ($context['_seq'] as $context["_key"] => $context["version"]) {
58
                // line 27
59
                echo "<link rel=\"search\"
60
                  type=\"application/opensearchdescription+xml\"
61
                  href=\"";
62
                // line 29
63
                echo twig_escape_filter($this->env, twig_replace_filter($this->getAttribute((isset($context["project"]) ? $context["project"] : $this->getContext($context, "project")), "config", array(0 => "base_url"), "method"), array("%version%" => $context["version"])), "html", null, true);
64
                echo "/opensearch.xml\"
65
                  title=\"";
66
                // line 30
67
                echo twig_escape_filter($this->env, $this->getAttribute((isset($context["project"]) ? $context["project"] : $this->getContext($context, "project")), "config", array(0 => "title"), "method"), "html", null, true);
68
                echo " (";
69
                echo twig_escape_filter($this->env, $context["version"], "html", null, true);
70
                echo ")\" />
71
        ";
72
            }
73
            $_parent = $context['_parent'];
74
            unset($context['_seq'], $context['_iterated'], $context['_key'], $context['version'], $context['_parent'], $context['loop']);
75
            $context = array_intersect_key($context, $_parent) + $_parent;
76
        }
77
        // line 33
78
        echo "</head>
79
80
";
81
        // line 35
82
        $this->displayBlock('html', $context, $blocks);
83
        // line 40
84
        echo "
85
</html>
86
";
87
    }
88
89
    // line 6
90
    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...
91
    {
92
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context["project"]) ? $context["project"] : $this->getContext($context, "project")), "config", array(0 => "title"), "method"), "html", null, true);
93
    }
94
95
    // line 8
96
    public function block_head($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...
97
    {
98
        // line 9
99
        echo "        <link rel=\"stylesheet\" type=\"text/css\" href=\"";
100
        echo twig_escape_filter($this->env, $this->env->getExtension('sami')->pathForStaticFile($context, "css/bootstrap.min.css"), "html", null, true);
101
        echo "\">
102
        <link rel=\"stylesheet\" type=\"text/css\" href=\"";
103
        // line 10
104
        echo twig_escape_filter($this->env, $this->env->getExtension('sami')->pathForStaticFile($context, "css/bootstrap-theme.min.css"), "html", null, true);
105
        echo "\">
106
        <link rel=\"stylesheet\" type=\"text/css\" href=\"";
107
        // line 11
108
        echo twig_escape_filter($this->env, $this->env->getExtension('sami')->pathForStaticFile($context, "css/sami.css"), "html", null, true);
109
        echo "\">
110
        <script src=\"";
111
        // line 12
112
        echo twig_escape_filter($this->env, $this->env->getExtension('sami')->pathForStaticFile($context, "js/jquery-1.11.1.min.js"), "html", null, true);
113
        echo "\"></script>
114
        <script src=\"";
115
        // line 13
116
        echo twig_escape_filter($this->env, $this->env->getExtension('sami')->pathForStaticFile($context, "js/bootstrap.min.js"), "html", null, true);
117
        echo "\"></script>
118
        <script src=\"";
119
        // line 14
120
        echo twig_escape_filter($this->env, $this->env->getExtension('sami')->pathForStaticFile($context, "js/typeahead.min.js"), "html", null, true);
121
        echo "\"></script>
122
        <script src=\"";
123
        // line 15
124
        echo twig_escape_filter($this->env, $this->env->getExtension('sami')->pathForStaticFile($context, "sami.js"), "html", null, true);
125
        echo "\"></script>
126
        <meta name=\"MobileOptimized\" content=\"width\">
127
        <meta name=\"HandheldFriendly\" content=\"true\">
128
        <meta name=\"viewport\" content=\"width=device-width,initial-scale=1,maximum-scale=1\">
129
    ";
130
    }
131
132
    // line 35
133
    public function block_html($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...
134
    {
135
        // line 36
136
        echo "    <body id=\"";
137
        $this->displayBlock('body_class', $context, $blocks);
138
        echo "\" data-name=\"";
139
        $this->displayBlock('page_id', $context, $blocks);
140
        echo "\" data-root-path=\"";
141
        echo twig_escape_filter($this->env, (isset($context["root_path"]) ? $context["root_path"] : $this->getContext($context, "root_path")), "html", null, true);
142
        echo "\">
143
        ";
144
        // line 37
145
        $this->displayBlock('content', $context, $blocks);
146
        // line 38
147
        echo "    </body>
148
";
149
    }
150
151
    // line 36
152
    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...
153
    {
154
        echo "";
155
    }
156
157
    public function block_page_id($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...
158
    {
159
        echo "";
160
    }
161
162
    // line 37
163
    public function block_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...
164
    {
165
        echo "";
166
    }
167
168
    public function getTemplateName()
169
    {
170
        return "layout/base.twig";
171
    }
172
173
    public function isTraitable()
174
    {
175
        return false;
176
    }
177
178
    public function getDebugInfo()
179
    {
180
        return array (  163 => 37,  152 => 36,  147 => 38,  145 => 37,  136 => 36,  133 => 35,  124 => 15,  120 => 14,  116 => 13,  112 => 12,  108 => 11,  104 => 10,  99 => 9,  96 => 8,  90 => 6,  84 => 40,  82 => 35,  78 => 33,  67 => 30,  63 => 29,  59 => 27,  55 => 26,  53 => 25,  50 => 24,  44 => 22,  42 => 21,  39 => 20,  37 => 8,  32 => 6,  25 => 1,);
181
    }
182
}
183
/* <!DOCTYPE html>*/
184
/* <html lang="en">*/
185
/* <head>*/
186
/*     <meta charset="UTF-8" />*/
187
/*     <meta name="robots" content="index, follow, all" />*/
188
/*     <title>{% block title project.config('title') %}</title>*/
189
/* */
190
/*     {% block head %}*/
191
/*         <link rel="stylesheet" type="text/css" href="{{ path('css/bootstrap.min.css') }}">*/
192
/*         <link rel="stylesheet" type="text/css" href="{{ path('css/bootstrap-theme.min.css') }}">*/
193
/*         <link rel="stylesheet" type="text/css" href="{{ path('css/sami.css') }}">*/
194
/*         <script src="{{ path('js/jquery-1.11.1.min.js') }}"></script>*/
195
/*         <script src="{{ path('js/bootstrap.min.js') }}"></script>*/
196
/*         <script src="{{ path('js/typeahead.min.js') }}"></script>*/
197
/*         <script src="{{ path('sami.js') }}"></script>*/
198
/*         <meta name="MobileOptimized" content="width">*/
199
/*         <meta name="HandheldFriendly" content="true">*/
200
/*         <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1">*/
201
/*     {% endblock %}*/
202
/* */
203
/*     {% if project.config('favicon') %}*/
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...
204
/*         <link rel="shortcut icon" href="{{ project.config('favicon') }}" />*/
205
/*     {% endif %}*/
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...
206
/* */
207
/*     {% if project.config('base_url') %}*/
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...
208
/*         {%- for version in project.versions -%}*/
209
/*             <link rel="search"*/
210
/*                   type="application/opensearchdescription+xml"*/
211
/*                   href="{{ project.config('base_url')|replace({'%version%': version}) }}/opensearch.xml"*/
212
/*                   title="{{ project.config('title') }} ({{ version }})" />*/
213
/*         {% endfor -%}*/
214
/*     {% endif %}*/
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...
215
/* </head>*/
216
/* */
217
/* {% block html %}*/
218
/*     <body id="{% block body_class '' %}" data-name="{% block page_id '' %}" data-root-path="{{ root_path }}">*/
219
/*         {% block content '' %}*/
220
/*     </body>*/
221
/* {% endblock %}*/
222
/* */
223
/* </html>*/
224
/* */
225