travi/php-framework

View on GitHub

Showing 140 of 176 total issues

Avoid deeply nested control flow statements.
Open

                        if ( ( $moz_release_date < 20020400 ) || ( $moz_rv < 1 ) )
                        {
                            $b_safe_browser = false;
                        }
Severity: Major
Found in php/thirdparty/browser_detection.php - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                            if ( $browser_number < 5 )// opera 4 wasn't very useable.
                            {
                                $b_safe_browser = false;
                            }
    Severity: Major
    Found in php/thirdparty/browser_detection.php - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                              for ( $j = 0; $j < $j_count; $j++ )
                              {
                                  if ( strstr( $browser_user_agent, $a_moz_types[$j] ) )
                                  {
                                      $moz_type = $a_moz_types[$j];
      Severity: Major
      Found in php/thirdparty/browser_detection.php - About 45 mins to fix

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

            private function addDependenciesToListForComponent(
                $dependencySourceList,
                &$component,
                $key,
                $requirement = null

        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

        Avoid deeply nested control flow statements.
        Open

                                if ( strstr( $browser_number, '9.' ) && strstr( $browser_user_agent, 'version/' ) )
                                {
                                    get_set_count( 'set', 0 );
                                    $browser_number = get_item_version( $browser_user_agent, 'version/' );
                                }
        Severity: Major
        Found in php/thirdparty/browser_detection.php - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                  for ( $j = 0; $j < $j_count; $j++ )
                                  {
                                      if ( strstr( $browser_user_agent, $a_webkit_types[$j] ) )
                                      {
                                          $webkit_type = $a_webkit_types[$j];
          Severity: Major
          Found in php/thirdparty/browser_detection.php - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                if(noshading==0) addShading(context,border,border,canvas.width-(border*2),canvas.height-(border*4),opacity);
            Severity: Major
            Found in client/thirdparty/instant/instant.js - About 45 mins to fix

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

                  public function resolveComponentDependencies($component)
                  {
                      if (is_object($component) && is_a($component, 'travi\\framework\\DependantObject')) {
                          $this->addDependencies($component->getDependencies(), $component);
                      } else if (is_array($component)) { //TODO: need to make this DRY

              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 addShading has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              function addShading(ctx,x,y,width,height,opacity) {
              Severity: Minor
              Found in client/thirdparty/instant/instant.js - About 45 mins to fix

                Function Set_Cookie has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                function Set_Cookie( name, value, expires, path, domain, secure ) {
                Severity: Minor
                Found in client/thirdparty/techPatterns/javascript_cookies.js - About 45 mins to fix

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

                      public function __construct($options = array())
                      {
                          if (isset($options['legend'])) {
                              $this->legend = $options['legend'];
                          }
                  Severity: Minor
                  Found in php/framework/src/travi/framework/components/Forms/FieldSet.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

                  Consider simplifying this complex logical expression.
                  Open

                                      if ( strstr( $pv_browser_string, 'os x' ) )
                                      {
                                          // if it doesn't have a version number, it is os x;
                                          if ( strstr( $pv_browser_string, 'os x ' ) )
                                          {
                  Severity: Major
                  Found in php/thirdparty/browser_detection.php - About 40 mins to fix

                    Function wavedPath has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    function wavedPath(x,y,w,h,r){
                    Severity: Minor
                    Found in client/thirdparty/instant/instant.js - About 35 mins to fix

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

                          function _httpsrequest($url,$URI,$http_method,$content_type="",$body="")
                      Severity: Minor
                      Found in php/thirdparty/Snoopy/Snoopy.class.php - About 35 mins to fix

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

                            public function init($config)
                            {
                                $this->config = $config;
                        
                                if (isset($config['siteName'])) {
                        Severity: Minor
                        Found in php/framework/src/travi/framework/http/Response.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 addReflections has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function addReflections() {
                            var rimages = document.myGetElementsByClassName('reflect');
                            for (i=0;i<rimages.length;i++) {
                                var rheight = null;
                                var ropacity = null;
                        Severity: Minor
                        Found in client/thirdparty/reflection/reflection.js - 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 execute has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function execute ()
                            {
                                $ch = curl_init();
                                $this->setAuth($ch);
                        
                        
                        Severity: Minor
                        Found in php/framework/src/travi/framework/http/RestClient.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 containsFormElementType has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function containsFormElementType($type)
                            {
                                foreach ($this->formElements as $formElement) {
                                    if (is_a($formElement, $type)) {
                                        return true;
                        Severity: Minor
                        Found in php/framework/src/travi/framework/components/Forms/FormElementGroup.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 constructObject has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function constructObject() {
                        
                                $this->loadMap();
                        
                                if ($this->_map->has('constructor')) {
                        Severity: Minor
                        Found in php/thirdparty/PHP-Dependency/library/Pd/Make/Constructor.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 getValidations has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function getValidations()
                            {
                                $validations = array();
                        
                                foreach ($this->formElements as $formElement) {
                        Severity: Minor
                        Found in php/framework/src/travi/framework/components/Forms/FormElementGroup.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

                        Severity
                        Category
                        Status
                        Source
                        Language