Kylob/Bootstrap

View on GitHub

Showing 31 of 35 total issues

Function firstTagAttributes has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    protected function firstTagAttributes($html, &$matches, $find = '<')
    {
        if (false !== $begin = strpos($html, $find)) {
            if (false !== $end = strpos($html, '>', $begin)) {
                $first = substr($html, $begin, $end - $begin + 1);
Severity: Minor
Found in src/Base.php - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function button has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function button($class, $name, array $options = array())
    {
        $attributes = array('type' => 'button');
        foreach ($options as $key => $value) {
            if (!in_array($key, array('dropdown', 'dropup', 'active', 'disabled', 'pull'))) {
Severity: Minor
Found in src/Common.php - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function listGroup has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function listGroup(array $links, $active = false)
    {
        $html = '';
        $tag = 'a';
        $count = 1;
Severity: Minor
Found in src/Common.php - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function row has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function row($size, $columns)
    {
        $html = '';
        $prefix = array();
        for ($i = 1; $i <= 12; ++$i) {
Severity: Minor
Found in src/Common.php - About 45 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function panel has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function panel($class, array $sections)
    {
        $html = '';
        foreach ($sections as $panel => $content) {
            if (!is_numeric($panel)) {
Severity: Minor
Found in src/Common.php - About 45 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method listItem has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    protected function listItem($link, $options, $name, $href, $count)
Severity: Minor
Found in src/Common.php - About 35 mins to fix

    Function search has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        public function search($url, array $form = array())
        {
            $html = '';
            $form = array_merge(array(
                'name' => 'search',
    Severity: Minor
    Found in src/Common.php - About 35 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function group has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        public function group($prepend, $append, $input)
        {
            if (!empty($prepend)) {
                foreach ((array) $prepend as $html) {
                    $class = (strpos($html, 'btn') !== false) ? 'input-group-btn' : 'input-group-addon';
    Severity: Minor
    Found in src/Form.php - About 35 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function breadcrumbs has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        public function breadcrumbs(array $links)
        {
            if (empty($links)) {
                return '';
            }
    Severity: Minor
    Found in src/Common.php - About 35 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function dropdown has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function dropdown(array $links, array $options = array(), &$count = 1)
        {
            $html = '';
            $toggle = (isset($options['toggle'])) ? ' data-toggle="'.$options['toggle'].'"' : '';
            foreach ($links as $name => $href) {
    Severity: Minor
    Found in src/Common.php - About 25 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function open has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        public function open($brand, $align = '', $inverse = false)
        {
            if (is_array($brand)) {
                list($brand, $link) = (count($brand) > 1) ? $brand : each($brand);
            } else {
    Severity: Minor
    Found in src/Navbar.php - About 25 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Severity
    Category
    Status
    Source
    Language