GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( c188f7...035d67 )
by Romain
05:21
created

doDisplay()   D

Complexity

Conditions 23
Paths 3

Size

Total Lines 42
Code Lines 20

Duplication

Lines 7
Ratio 16.67 %

Importance

Changes 0
Metric Value
dl 7
loc 42
rs 4.7895
c 0
b 0
f 0
cc 23
eloc 20
nc 3
nop 2

How to fix   Complexity   

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
/* opensearch.twig */
4
class __TwigTemplate_38b46a007d69fcaef63805d5b1e5e1a6f5cc8171abc60d1a4639698b2792a1e2 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...
5
{
6
    public function __construct(Twig_Environment $env)
7
    {
8
        parent::__construct($env);
9
10
        $this->parent = false;
11
12
        $this->blocks = array(
13
        );
14
    }
15
16
    protected function doDisplay(array $context, array $blocks = array())
17
    {
18
        // line 1
19
        if (twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["project"]) || array_key_exists("project", $context) ? $context["project"] : (function () { throw new Twig_Error_Runtime('Variable "project" does not exist.', 1, $this->getSourceContext()); })()), "config", array(0 => "base_url"), "method")) {
20
            // line 2
21
            echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
22
    <OpenSearchDescription xmlns=\"http://a9.com/-/spec/opensearch/1.1/\" xmlns:referrer=\"http://a9.com/-/opensearch/extensions/referrer/\">
23
        <ShortName>";
24
            // line 4
25
            echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["project"]) || array_key_exists("project", $context) ? $context["project"] : (function () { throw new Twig_Error_Runtime('Variable "project" does not exist.', 4, $this->getSourceContext()); })()), "config", array(0 => "title"), "method"), "html", null, true);
26
            echo " (";
27
            echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["project"]) || array_key_exists("project", $context) ? $context["project"] : (function () { throw new Twig_Error_Runtime('Variable "project" does not exist.', 4, $this->getSourceContext()); })()), "version", array()), "html", null, true);
28
            echo ")</ShortName>
29
        <Description>Searches ";
30
            // line 5
31
            echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["project"]) || array_key_exists("project", $context) ? $context["project"] : (function () { throw new Twig_Error_Runtime('Variable "project" does not exist.', 5, $this->getSourceContext()); })()), "config", array(0 => "title"), "method"), "html", null, true);
32
            echo " (";
33
            echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["project"]) || array_key_exists("project", $context) ? $context["project"] : (function () { throw new Twig_Error_Runtime('Variable "project" does not exist.', 5, $this->getSourceContext()); })()), "version", array()), "html", null, true);
34
            echo ")</Description>
35
        <Tags>";
36
            // line 6
37
            echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["project"]) || array_key_exists("project", $context) ? $context["project"] : (function () { throw new Twig_Error_Runtime('Variable "project" does not exist.', 6, $this->getSourceContext()); })()), "config", array(0 => "title"), "method"), "html", null, true);
38
            echo "</Tags>
39
        ";
40
            // line 7
41 View Code Duplication
            if (twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["project"]) || array_key_exists("project", $context) ? $context["project"] : (function () { throw new Twig_Error_Runtime('Variable "project" does not exist.', 7, $this->getSourceContext()); })()), "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...
42
                // line 8
43
                echo "<Image height=\"16\" width=\"16\" type=\"image/x-icon\">";
44
                echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["project"]) || array_key_exists("project", $context) ? $context["project"] : (function () { throw new Twig_Error_Runtime('Variable "project" does not exist.', 8, $this->getSourceContext()); })()), "config", array(0 => "favicon"), "method"), "html", null, true);
45
                echo "</Image>
46
        ";
47
            }
48
            // line 10
49
            echo "        <Url type=\"text/html\" method=\"GET\" template=\"";
50
            echo twig_escape_filter($this->env, (twig_replace_filter(twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["project"]) || array_key_exists("project", $context) ? $context["project"] : (function () { throw new Twig_Error_Runtime('Variable "project" does not exist.', 10, $this->getSourceContext()); })()), "config", array(0 => "base_url"), "method"), array("%version%" => twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["project"]) || array_key_exists("project", $context) ? $context["project"] : (function () { throw new Twig_Error_Runtime('Variable "project" does not exist.', 10, $this->getSourceContext()); })()), "version", array()))) . "/index.html?q={searchTerms}&src={referrer:source?}"), "html", null, true);
51
            echo "\"/>
52
        <InputEncoding>UTF-8</InputEncoding>
53
        <AdultContent>false</AdultContent>
54
    </OpenSearchDescription>
55
";
56
        }
57
    }
58
59
    public function getTemplateName()
60
    {
61
        return "opensearch.twig";
62
    }
63
64
    public function isTraitable()
65
    {
66
        return false;
67
    }
68
69
    public function getDebugInfo()
70
    {
71
        return array (  49 => 10,  43 => 8,  41 => 7,  37 => 6,  31 => 5,  25 => 4,  21 => 2,  19 => 1,);
72
    }
73
74
    public function getSourceContext()
75
    {
76
        return new Twig_Source("{% if project.config('base_url') -%}
77
    <?xml version=\"1.0\" encoding=\"UTF-8\"?>
78
    <OpenSearchDescription xmlns=\"http://a9.com/-/spec/opensearch/1.1/\" xmlns:referrer=\"http://a9.com/-/opensearch/extensions/referrer/\">
79
        <ShortName>{{ project.config('title') }} ({{ project.version }})</ShortName>
80
        <Description>Searches {{ project.config('title') }} ({{ project.version }})</Description>
81
        <Tags>{{ project.config('title') }}</Tags>
82
        {% if project.config('favicon') -%}
83
            <Image height=\"16\" width=\"16\" type=\"image/x-icon\">{{ project.config('favicon') }}</Image>
84
        {% endif %}
85
        <Url type=\"text/html\" method=\"GET\" template=\"{{ project.config('base_url')|replace({'%version%': project.version}) ~ '/index.html?q={searchTerms}&src={referrer:source?}' }}\"/>
86
        <InputEncoding>UTF-8</InputEncoding>
87
        <AdultContent>false</AdultContent>
88
    </OpenSearchDescription>
89
{% endif %}
90
", "opensearch.twig", "phar:///Users/bobby/Dropbox/Sites/OpenSource/Slackify/sami.phar/Sami/Resources/themes/default/opensearch.twig");
91
    }
92
}
93