railpage/railpagecore

View on GitHub
lib/Images/Statistics.php

Summary

Maintainability
D
1 day
Test Coverage

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

    public function getMostViewedPhotos($lookup = self::HITS_WEEKLY, $num = 5) {
        
        $allowed = [ 
            self::HITS_DAILY => "hits_today",
            self::HITS_WEEKLY => "hits_weekly",
Severity: Minor
Found in lib/Images/Statistics.php - About 1 hr to fix

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

        public function getStatsForCamera(Camera $cameraObject) {
            
            $query = "(SELECT 'Photos on Railpage' AS label, COUNT(*) AS value FROM image_exif WHERE camera_id = ?)
                UNION (SELECT 'Most used lens' AS label, l.model AS value FROM image_exif AS e LEFT JOIN image_lens AS l ON e.lens_id = l.id WHERE e.camera_id = ? GROUP BY e.lens_id ORDER BY COUNT(*) DESC LIMIT 1)
                UNION (SELECT 'Screener\'s Choice' AS label, COUNT(*) AS value FROM image_flags AS f LEFT JOIN image_exif AS e ON e.image_id = f.image_id WHERE e.camera_id = ? AND f.screened_pick = 1)";
    Severity: Minor
    Found in lib/Images/Statistics.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

    Avoid using undefined variables such as '$params' which will lead to PHP notices.
    Open

            $params[] = $cameraObject->id;
    Severity: Minor
    Found in lib/Images/Statistics.php by phpmd

    UndefinedVariable

    Since: 2.8.0

    Detects when a variable is used that has not been defined before.

    Example

    class Foo
    {
        private function bar()
        {
            // $message is undefined
            echo $message;
        }
    }

    Source https://phpmd.org/rules/cleancode.html#undefinedvariable

    Avoid using undefined variables such as '$params' which will lead to PHP notices.
    Open

            $params[] = $cameraObject->id;
    Severity: Minor
    Found in lib/Images/Statistics.php by phpmd

    UndefinedVariable

    Since: 2.8.0

    Detects when a variable is used that has not been defined before.

    Example

    class Foo
    {
        private function bar()
        {
            // $message is undefined
            echo $message;
        }
    }

    Source https://phpmd.org/rules/cleancode.html#undefinedvariable

    Avoid using undefined variables such as '$params' which will lead to PHP notices.
    Open

            $result = $this->db->fetchAll($query, $params); 
    Severity: Minor
    Found in lib/Images/Statistics.php by phpmd

    UndefinedVariable

    Since: 2.8.0

    Detects when a variable is used that has not been defined before.

    Example

    class Foo
    {
        private function bar()
        {
            // $message is undefined
            echo $message;
        }
    }

    Source https://phpmd.org/rules/cleancode.html#undefinedvariable

    Avoid using undefined variables such as '$params' which will lead to PHP notices.
    Open

            $params[] = $cameraObject->id;
    Severity: Minor
    Found in lib/Images/Statistics.php by phpmd

    UndefinedVariable

    Since: 2.8.0

    Detects when a variable is used that has not been defined before.

    Example

    class Foo
    {
        private function bar()
        {
            // $message is undefined
            echo $message;
        }
    }

    Source https://phpmd.org/rules/cleancode.html#undefinedvariable

    Avoid unused private methods such as 'getPhotosByFocalLength'.
    Open

        private function getPhotosByFocalLength() {
            
            $query = "SELECT FLOOR(focal_length / 10) * 10 AS `key`, COUNT(*) AS `val` FROM image_exif WHERE focal_length > 10 AND focal_length <= 500 GROUP BY `key`";
            
            return $this->db->fetchAll($query); 
    Severity: Minor
    Found in lib/Images/Statistics.php by phpmd

    UnusedPrivateMethod

    Since: 0.2

    Unused Private Method detects when a private method is declared but is unused.

    Example

    class Something
    {
        private function foo() {} // unused
    }

    Source https://phpmd.org/rules/unusedcode.html#unusedprivatemethod

    Avoid unused private methods such as 'getCameraModelsByAuthor'.
    Open

        private function getCameraModelsByAuthor() {
            
            $query = 'SELECT CONCAT(camera_make, " ", camera_model) AS `key`, COUNT(*) AS number, href FROM (
                SELECT DISTINCT e.camera_id, i.user_id, c.make AS camera_make, c.model AS camera_model, CONCAT("/photos/cameras/", c.url_slug) AS href
                FROM image_exif AS e 
    Severity: Minor
    Found in lib/Images/Statistics.php by phpmd

    UnusedPrivateMethod

    Since: 0.2

    Unused Private Method detects when a private method is declared but is unused.

    Example

    class Something
    {
        private function foo() {} // unused
    }

    Source https://phpmd.org/rules/unusedcode.html#unusedprivatemethod

    Avoid unused private methods such as 'getPhotosByAperture'.
    Open

        private function getPhotosByAperture() {
            
            $query = "SELECT * FROM (SELECT aperture AS `key`, COUNT(*) AS `val` FROM image_exif WHERE aperture > 0 AND aperture < 40 GROUP BY `key`) AS ap WHERE `val` > 1";
            
            return $this->db->fetchAll($query); 
    Severity: Minor
    Found in lib/Images/Statistics.php by phpmd

    UnusedPrivateMethod

    Since: 0.2

    Unused Private Method detects when a private method is declared but is unused.

    Example

    class Something
    {
        private function foo() {} // unused
    }

    Source https://phpmd.org/rules/unusedcode.html#unusedprivatemethod

    Avoid unused private methods such as 'getCameraModelsByPhotos'.
    Open

        private function getCameraModelsByPhotos() {
            
            $query = 'SELECT CONCAT(camera_make, " ", camera_model) AS `key`, COUNT(*) AS number, href FROM (
                SELECT e.camera_id, i.user_id, c.make AS camera_make, c.model AS camera_model, CONCAT("/photos/cameras/", c.url_slug) AS href
                FROM image_exif AS e 
    Severity: Minor
    Found in lib/Images/Statistics.php by phpmd

    UnusedPrivateMethod

    Since: 0.2

    Unused Private Method detects when a private method is declared but is unused.

    Example

    class Something
    {
        private function foo() {} // unused
    }

    Source https://phpmd.org/rules/unusedcode.html#unusedprivatemethod

    Avoid unused private methods such as 'getPhotosByExposureProgram'.
    Open

        private function getPhotosByExposureProgram() {
            
            $query = "SELECT ep.program AS `key`, COUNT(*) AS `number` FROM image_exif AS ef LEFT JOIN image_exposure_program AS ep ON ef.exposure_program_id = ep.id WHERE ep.program != \"Unknown\" GROUP BY ep.id ORDER BY COUNT(*) DESC LIMIT 0, 7";
            
            $return = [];
    Severity: Minor
    Found in lib/Images/Statistics.php by phpmd

    UnusedPrivateMethod

    Since: 0.2

    Unused Private Method detects when a private method is declared but is unused.

    Example

    class Something
    {
        private function foo() {} // unused
    }

    Source https://phpmd.org/rules/unusedcode.html#unusedprivatemethod

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

        private function getCameraModelsByAuthor() {
            
            $query = 'SELECT CONCAT(camera_make, " ", camera_model) AS `key`, COUNT(*) AS number, href FROM (
                SELECT DISTINCT e.camera_id, i.user_id, c.make AS camera_make, c.model AS camera_model, CONCAT("/photos/cameras/", c.url_slug) AS href
                FROM image_exif AS e 
    Severity: Major
    Found in lib/Images/Statistics.php and 1 other location - About 4 hrs to fix
    lib/Images/Statistics.php on lines 222..242

    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 106.

    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 2 locations. Consider refactoring.
    Open

        private function getCameraModelsByPhotos() {
            
            $query = 'SELECT CONCAT(camera_make, " ", camera_model) AS `key`, COUNT(*) AS number, href FROM (
                SELECT e.camera_id, i.user_id, c.make AS camera_make, c.model AS camera_model, CONCAT("/photos/cameras/", c.url_slug) AS href
                FROM image_exif AS e 
    Severity: Major
    Found in lib/Images/Statistics.php and 1 other location - About 4 hrs to fix
    lib/Images/Statistics.php on lines 193..214

    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 106.

    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 15 locations. Consider refactoring.
    Open

        public function getContributors() {
            
            $query = "SELECT u.username, u.user_id, CONCAT('/user/', u.user_id) AS url, COUNT(*) AS num FROM nuke_users AS u LEFT JOIN image AS i ON i.user_id = u.user_id WHERE i.user_id != 0 AND i.provider != 'rpoldgallery' GROUP BY u.user_id ORDER BY num DESC LIMIT 0, 10";
            
            return $this->db->fetchAll($query); 
    Severity: Major
    Found in lib/Images/Statistics.php and 14 other locations - About 35 mins to fix
    lib/Images/Competitions.php on lines 332..341
    lib/Images/Screener.php on lines 258..269
    lib/Images/Statistics.php on lines 93..104
    lib/Images/Statistics.php on lines 112..133
    lib/Images/Statistics.php on lines 155..170
    lib/Images/Statistics.php on lines 250..256
    lib/Images/Statistics.php on lines 264..270
    lib/Links/Links.php on lines 227..231
    lib/Locations/Locations.php on lines 204..213
    lib/Locations/Locations.php on lines 531..535
    lib/Locos/Liveries/Liveries.php on lines 86..96
    lib/Users/Admin.php on lines 34..39
    lib/Users/Base.php on lines 234..238
    lib/Users/Base.php on lines 271..283

    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 22.

    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 15 locations. Consider refactoring.
    Open

        private function getPhotosByAperture() {
            
            $query = "SELECT * FROM (SELECT aperture AS `key`, COUNT(*) AS `val` FROM image_exif WHERE aperture > 0 AND aperture < 40 GROUP BY `key`) AS ap WHERE `val` > 1";
            
            return $this->db->fetchAll($query); 
    Severity: Major
    Found in lib/Images/Statistics.php and 14 other locations - About 35 mins to fix
    lib/Images/Competitions.php on lines 332..341
    lib/Images/Screener.php on lines 258..269
    lib/Images/Statistics.php on lines 93..104
    lib/Images/Statistics.php on lines 112..133
    lib/Images/Statistics.php on lines 141..147
    lib/Images/Statistics.php on lines 155..170
    lib/Images/Statistics.php on lines 250..256
    lib/Links/Links.php on lines 227..231
    lib/Locations/Locations.php on lines 204..213
    lib/Locations/Locations.php on lines 531..535
    lib/Locos/Liveries/Liveries.php on lines 86..96
    lib/Users/Admin.php on lines 34..39
    lib/Users/Base.php on lines 234..238
    lib/Users/Base.php on lines 271..283

    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 22.

    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 15 locations. Consider refactoring.
    Open

        private function getPhotosByFocalLength() {
            
            $query = "SELECT FLOOR(focal_length / 10) * 10 AS `key`, COUNT(*) AS `val` FROM image_exif WHERE focal_length > 10 AND focal_length <= 500 GROUP BY `key`";
            
            return $this->db->fetchAll($query); 
    Severity: Major
    Found in lib/Images/Statistics.php and 14 other locations - About 35 mins to fix
    lib/Images/Competitions.php on lines 332..341
    lib/Images/Screener.php on lines 258..269
    lib/Images/Statistics.php on lines 93..104
    lib/Images/Statistics.php on lines 112..133
    lib/Images/Statistics.php on lines 141..147
    lib/Images/Statistics.php on lines 155..170
    lib/Images/Statistics.php on lines 264..270
    lib/Links/Links.php on lines 227..231
    lib/Locations/Locations.php on lines 204..213
    lib/Locations/Locations.php on lines 531..535
    lib/Locos/Liveries/Liveries.php on lines 86..96
    lib/Users/Admin.php on lines 34..39
    lib/Users/Base.php on lines 234..238
    lib/Users/Base.php on lines 271..283

    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 22.

    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 15 locations. Consider refactoring.
    Open

        public function getContributorWithTaggedPhotos() {
            
            $query = "SELECT u.username, u.user_id, CONCAT('/user/', u.user_id) AS url, COUNT(*) AS num 
                FROM nuke_users AS u 
                LEFT JOIN image AS i ON i.user_id = u.user_id 
    Severity: Major
    Found in lib/Images/Statistics.php and 14 other locations - About 35 mins to fix
    lib/Images/Competitions.php on lines 332..341
    lib/Images/Screener.php on lines 258..269
    lib/Images/Statistics.php on lines 93..104
    lib/Images/Statistics.php on lines 112..133
    lib/Images/Statistics.php on lines 141..147
    lib/Images/Statistics.php on lines 250..256
    lib/Images/Statistics.php on lines 264..270
    lib/Links/Links.php on lines 227..231
    lib/Locations/Locations.php on lines 204..213
    lib/Locations/Locations.php on lines 531..535
    lib/Locos/Liveries/Liveries.php on lines 86..96
    lib/Users/Admin.php on lines 34..39
    lib/Users/Base.php on lines 234..238
    lib/Users/Base.php on lines 271..283

    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 22.

    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 15 locations. Consider refactoring.
    Open

        public function getNumPhotosByRegion() {
            
            $query = "SELECT g.country_code, g.country_name, g.region_code, g.region_name, COUNT(*) AS count
                FROM image AS i
                LEFT JOIN geoplace AS g ON i.geoplace = g.id
    Severity: Major
    Found in lib/Images/Statistics.php and 14 other locations - About 35 mins to fix
    lib/Images/Competitions.php on lines 332..341
    lib/Images/Screener.php on lines 258..269
    lib/Images/Statistics.php on lines 112..133
    lib/Images/Statistics.php on lines 141..147
    lib/Images/Statistics.php on lines 155..170
    lib/Images/Statistics.php on lines 250..256
    lib/Images/Statistics.php on lines 264..270
    lib/Links/Links.php on lines 227..231
    lib/Locations/Locations.php on lines 204..213
    lib/Locations/Locations.php on lines 531..535
    lib/Locos/Liveries/Liveries.php on lines 86..96
    lib/Users/Admin.php on lines 34..39
    lib/Users/Base.php on lines 234..238
    lib/Users/Base.php on lines 271..283

    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 22.

    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 15 locations. Consider refactoring.
    Open

        public function getQuantities() {
            
            $query = 'SELECT "Total photos" AS title, FORMAT(COUNT(*), 0) AS num FROM image
                UNION SELECT "Photos with latitude/longitude" AS title, FORMAT(COUNT(*), 0) AS num FROM image WHERE ROUND(lat) != 0
                UNION SELECT "Photos without latitude/longitude" AS title, FORMAT(COUNT(*), 0) AS num FROM image WHERE ROUND(lat) = 0
    Severity: Major
    Found in lib/Images/Statistics.php and 14 other locations - About 35 mins to fix
    lib/Images/Competitions.php on lines 332..341
    lib/Images/Screener.php on lines 258..269
    lib/Images/Statistics.php on lines 93..104
    lib/Images/Statistics.php on lines 141..147
    lib/Images/Statistics.php on lines 155..170
    lib/Images/Statistics.php on lines 250..256
    lib/Images/Statistics.php on lines 264..270
    lib/Links/Links.php on lines 227..231
    lib/Locations/Locations.php on lines 204..213
    lib/Locations/Locations.php on lines 531..535
    lib/Locos/Liveries/Liveries.php on lines 86..96
    lib/Users/Admin.php on lines 34..39
    lib/Users/Base.php on lines 234..238
    lib/Users/Base.php on lines 271..283

    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 22.

    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 2 locations. Consider refactoring.
    Open

            if (!in_array($lookup, array_keys($allowed))) {
                throw new InvalidArgumentException("Parameter supplied for lookup type is invalid"); 
            }
    Severity: Minor
    Found in lib/Images/Statistics.php and 1 other location - About 30 mins to fix
    lib/Images/ImageCache.php on lines 60..62

    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 21.

    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

    Function closing brace must go on the next line following the body; found 1 blank lines before brace
    Open

        }
    Severity: Minor
    Found in lib/Images/Statistics.php by phpcodesniffer

    Function closing brace must go on the next line following the body; found 1 blank lines before brace
    Open

        }
    Severity: Minor
    Found in lib/Images/Statistics.php by phpcodesniffer

    Function closing brace must go on the next line following the body; found 1 blank lines before brace
    Open

        }
    Severity: Minor
    Found in lib/Images/Statistics.php by phpcodesniffer

    Function closing brace must go on the next line following the body; found 1 blank lines before brace
    Open

        }
    Severity: Minor
    Found in lib/Images/Statistics.php by phpcodesniffer

    Function closing brace must go on the next line following the body; found 1 blank lines before brace
    Open

        }
    Severity: Minor
    Found in lib/Images/Statistics.php by phpcodesniffer

    Function closing brace must go on the next line following the body; found 1 blank lines before brace
    Open

        }
    Severity: Minor
    Found in lib/Images/Statistics.php by phpcodesniffer

    Function closing brace must go on the next line following the body; found 1 blank lines before brace
    Open

        }
    Severity: Minor
    Found in lib/Images/Statistics.php by phpcodesniffer

    Function closing brace must go on the next line following the body; found 1 blank lines before brace
    Open

        }
    Severity: Minor
    Found in lib/Images/Statistics.php by phpcodesniffer

    Function closing brace must go on the next line following the body; found 1 blank lines before brace
    Open

        }
    Severity: Minor
    Found in lib/Images/Statistics.php by phpcodesniffer

    Function closing brace must go on the next line following the body; found 1 blank lines before brace
    Open

        }
    Severity: Minor
    Found in lib/Images/Statistics.php by phpcodesniffer

    Function closing brace must go on the next line following the body; found 1 blank lines before brace
    Open

        }
    Severity: Minor
    Found in lib/Images/Statistics.php by phpcodesniffer

    Function closing brace must go on the next line following the body; found 1 blank lines before brace
    Open

        }
    Severity: Minor
    Found in lib/Images/Statistics.php by phpcodesniffer

    There are no issues that match your filters.

    Category
    Status