TeaThemeOptions/TeaThemeOptions

View on GitHub
src/Core/Field/Social.php

Summary

Maintainability
D
2 days
Test Coverage

Method getSocialNetworks has 212 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getSocialNetworks()
    {
        return array(
            'twitter'       => array(
                'url'           => OlympusZeus::translate('http://www.twitter.com/'),
Severity: Major
Found in src/Core/Field/Social.php - About 1 day to fix

    File Social.php has 319 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    namespace crewstyle\OlympusZeus\Core\Field;
    
    use crewstyle\OlympusZeus\OlympusZeus;
    Severity: Minor
    Found in src/Core/Field/Social.php - About 3 hrs to fix

      Function hex2rgb has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function hex2rgb($hexcolor) 
          {
              preg_match("/^#{0,1}([0-9a-f]{1,6})$/i", $hexcolor, $match);
      
              if (!isset($match[1])) {
      Severity: Minor
      Found in src/Core/Field/Social.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

      Method hex2rgb has 46 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function hex2rgb($hexcolor) 
          {
              preg_match("/^#{0,1}([0-9a-f]{1,6})$/i", $hexcolor, $match);
      
              if (!isset($match[1])) {
      Severity: Minor
      Found in src/Core/Field/Social.php - About 1 hr to fix

        Method prepareField has 43 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function prepareField($content, $details = array())
            {
                //Build details
                $post = isset($details['post']) ? $details['post'] : 0;
                $prefix = isset($details['prefix']) ? $details['prefix'] : '';
        Severity: Minor
        Found in src/Core/Field/Social.php - About 1 hr to fix

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

              public function prepareField($content, $details = array())
              {
                  //Build details
                  $post = isset($details['post']) ? $details['post'] : 0;
                  $prefix = isset($details['prefix']) ? $details['prefix'] : '';
          Severity: Minor
          Found in src/Core/Field/Social.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

          There are no issues that match your filters.

          Category
          Status