lucliscio/fanKounter

View on GitHub

Showing 79 of 86 total issues

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

  function _get_hits_($__timestamp, $__type) {
    settype($__timestamp,"integer");
    settype($__type,"string");

    $__year=date("Y",$__timestamp);
Severity: Minor
Found in src/cal.inc.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 _array2string has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    protected function _array2string($array)
    {
        $content = "array(\n";

        foreach ($array as $key => $value) {
Severity: Minor
Found in src/libs/Browscap.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 _licit_request_ has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

function _licit_request_(){
 global $aux__location;

 if(($__normloc=$aux__location->_normalize_())===FALSE)
  return FALSE;
Severity: Minor
Found in src/mak.inc.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

Identical blocks of code found in 2 locations. Consider refactoring.
Open

                if (!$countMatches) {
                    $tmpPatterns[$pattern] = $i;
                } else {
                    $compressedPattern = preg_replace(
                        self::REGEX_DELIMITER . '\d' . self::REGEX_DELIMITER,
Severity: Major
Found in src/libs/Browscap.php and 1 other location - About 1 hr to fix
src/libs/Browscap.php on lines 784..798

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 104.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

                if (!$countMatches) {
                    $tmpPatterns[$pattern] = $i;
                } else {
                    $compressedPattern = preg_replace(
                        self::REGEX_DELIMITER . '\d' . self::REGEX_DELIMITER,
Severity: Major
Found in src/libs/Browscap.php and 1 other location - About 1 hr to fix
src/libs/Browscap.php on lines 669..683

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 104.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Method path_replace has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function path_replace( $html, $tpl_basedir ){

        if( self::$path_replace ){

            $tpl_dir = self::$base_url . self::$tpl_dir . $tpl_basedir;
Severity: Minor
Found in src/libs/rain.tpl.class.php - About 1 hr to fix

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

    function _fcreate_($__name,$__content){
      settype($__name,"string");
      settype($__content,"string");
    
      if(($__fid=fopen(WEB_ROOT.$__name,"wb"))!==FALSE){
    Severity: Minor
    Found in src/sys.inc.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 _max_hits_in_date_ has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

      function _max_hits_in_date_() {
        global $aux__now;
    
        $__max=array("timestamp"=>$aux__now,"hits"=>0);
    
    Severity: Minor
    Found in src/cal.inc.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 printDebug has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function printDebug(RainTpl_Exception $e){
            if (!self::$debug) {
                throw $e;
            }
            $output = sprintf('<h2>Exception: %s</h2><h3>%s</h3><p>template: %s</p>',
    Severity: Minor
    Found in src/libs/rain.tpl.class.php - About 1 hr to fix

      Method __construct has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

       public function __construct($__url){
        settype($__url,"string");
      
        global $inf__engine,$inf__keyban;
      
      Severity: Minor
      Found in src/url.inc.php - About 1 hr to fix

        Function printDebug has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            protected function printDebug(RainTpl_Exception $e){
                if (!self::$debug) {
                    throw $e;
                }
                $output = sprintf('<h2>Exception: %s</h2><h3>%s</h3><p>template: %s</p>',
        Severity: Minor
        Found in src/libs/rain.tpl.class.php - About 55 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 _make_year_ has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

          function _make_year_($__year) {
            settype($__year,"string");
        
            if(!array_key_exists($__year,$this->__year)){
              $this->__year[$__year]=array();
        Severity: Minor
        Found in src/cal.inc.php - About 55 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 clearProxySettings has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            public function clearProxySettings($wrapper = null)
            {
                $wrappers = isset($wrapper) ? array($wrapper) : array_keys($this->_streamContextOptions);
        
                $clearedWrappers = array();
        Severity: Minor
        Found in src/libs/Browscap.php - About 55 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 draw has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            function draw( $tpl_name, $return_string = false ){
        
                try {
                    // compile the template if necessary and set the template filepath
                    $this->check_template( $tpl_name );
        Severity: Minor
        Found in src/libs/rain.tpl.class.php - About 55 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 const_replace has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            function const_replace( $html, $tag_left_delimiter, $tag_right_delimiter, $php_left_delimiter = null, $php_right_delimiter = null, $loop_level = null, $echo = null ){
        Severity: Major
        Found in src/libs/rain.tpl.class.php - About 50 mins to fix

          Method func_replace has 7 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              function func_replace( $html, $tag_left_delimiter, $tag_right_delimiter, $php_left_delimiter = null, $php_right_delimiter = null, $loop_level = null, $echo = null ){
          Severity: Major
          Found in src/libs/rain.tpl.class.php - About 50 mins to fix

            Method var_replace has 7 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                function var_replace( $html, $tag_left_delimiter, $tag_right_delimiter, $php_left_delimiter = null, $php_right_delimiter = null, $loop_level = null, $echo = null ){
            Severity: Major
            Found in src/libs/rain.tpl.class.php - About 50 mins to fix

              Similar blocks of code found in 14 locations. Consider refactoring.
              Open

              $dat__calendar["2018"]=array(array(0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,3,0,0,0,0,0,0,1,0,0),array(0,0,0,0,0,0,0,0,0,0,0,6,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0));
              Severity: Major
              Found in src/data/data_example.php and 13 other locations - About 50 mins to fix
              src/data/data_example.php on lines 9..9
              src/data/data_example.php on lines 9..9
              src/data/data_example.php on lines 9..9
              src/data/data_example.php on lines 9..9
              src/data/data_example.php on lines 9..9
              src/data/data_example.php on lines 9..9
              src/data/data_example.php on lines 10..10
              src/data/data_example.php on lines 10..10
              src/data/data_example.php on lines 10..10
              src/data/data_example.php on lines 10..10
              src/data/data_example.php on lines 10..10
              src/data/data_example.php on lines 10..10
              src/data/data_example.php on lines 10..10

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 97.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 14 locations. Consider refactoring.
              Open

              $dat__calendar["2020"]=array(array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,2,3,0,2,3,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0));
              Severity: Major
              Found in src/data/data_example.php and 13 other locations - About 50 mins to fix
              src/data/data_example.php on lines 9..9
              src/data/data_example.php on lines 9..9
              src/data/data_example.php on lines 9..9
              src/data/data_example.php on lines 9..9
              src/data/data_example.php on lines 9..9
              src/data/data_example.php on lines 9..9
              src/data/data_example.php on lines 9..9
              src/data/data_example.php on lines 10..10
              src/data/data_example.php on lines 10..10
              src/data/data_example.php on lines 10..10
              src/data/data_example.php on lines 10..10
              src/data/data_example.php on lines 10..10
              src/data/data_example.php on lines 10..10

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 97.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Avoid deeply nested control flow statements.
              Open

                                          while (!feof($remote_handler)) {
                                              $file .= fgets($remote_handler);
                                          }
              Severity: Major
              Found in src/libs/Browscap.php - About 45 mins to fix
                Severity
                Category
                Status
                Source
                Language