railpage/railpagecore

View on GitHub
lib/Users/Timeline/Utility/ObjectTitle.php

Summary

Maintainability
D
2 days
Test Coverage

Method generateTitle has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function generateTitle($row) {
        
        self::$row = $row;
        
        switch (self::$row['key']) {
Severity: Minor
Found in lib/Users/Timeline/Utility/ObjectTitle.php - About 1 hr to fix

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

        public static function generateTitle($row) {
            
            self::$row = $row;
            
            switch (self::$row['key']) {
    Severity: Minor
    Found in lib/Users/Timeline/Utility/ObjectTitle.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 processSighting has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        private static function processSighting() {
            if (empty(self::$row['module']) || !isset(self::$row['module'])) {
                self::$row['module'] = "sightings";
            }
            
    Severity: Minor
    Found in lib/Users/Timeline/Utility/ObjectTitle.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

    The method processLocomotive uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
    Open

            } else {
                self::$row['meta']['object']['title'] = $Loco->number;
                self::$row['meta']['object']['subtitle'] = $Loco->class->name;
            }

    ElseExpression

    Since: 1.4.0

    An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

    Example

    class Foo
    {
        public function bar($flag)
        {
            if ($flag) {
                // one branch
            } else {
                // another branch
            }
        }
    }

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

    The method processSighting uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
    Open

            } else {
                $locos = array();
                foreach (self::$row['args']['locos'] as $loco) {
                    $locos[] = $loco['Locomotive'];
                }

    ElseExpression

    Since: 1.4.0

    An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

    Example

    class Foo
    {
        public function bar($flag)
        {
            if ($flag) {
                // one branch
            } else {
                // another branch
            }
        }
    }

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

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

                self::$row['meta']['object']['title'] = self::$row['args']['locos'][key(self::$row['args']['locos'])]['Locomotive'];
    Severity: Major
    Found in lib/Users/Timeline/Utility/ObjectTitle.php and 1 other location - About 2 hrs to fix
    lib/Users/Timeline/Utility/ObjectTitle.php on lines 206..206

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

    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

                self::$row['meta']['object']['title'] = self::$row['args']['locos'][key(self::$row['args']['locos'])]['Locomotive'];
    Severity: Major
    Found in lib/Users/Timeline/Utility/ObjectTitle.php and 1 other location - About 2 hrs to fix
    lib/Users/Timeline/Utility/ObjectTitle.php on lines 208..208

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

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

                self::$row['meta']['object']['subtitle'] = $Loco->class->name;
    Severity: Major
    Found in lib/Users/Timeline/Utility/ObjectTitle.php and 2 other locations - About 45 mins to fix
    lib/Users/Timeline/Utility/ObjectTitle.php on lines 113..113
    lib/Users/Timeline/Utility/ObjectTitle.php on lines 133..133

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

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

            self::$row['meta']['object']['title'] = $Post->thread->title;
    Severity: Major
    Found in lib/Users/Timeline/Utility/ObjectTitle.php and 2 other locations - About 45 mins to fix
    lib/Users/Timeline/Utility/ObjectTitle.php on lines 133..133
    lib/Users/Timeline/Utility/ObjectTitle.php on lines 136..136

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

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

                self::$row['meta']['object']['title'] = $Loco->class->name;
    Severity: Major
    Found in lib/Users/Timeline/Utility/ObjectTitle.php and 2 other locations - About 45 mins to fix
    lib/Users/Timeline/Utility/ObjectTitle.php on lines 113..113
    lib/Users/Timeline/Utility/ObjectTitle.php on lines 136..136

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

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

            self::$row['meta']['object']['title'] = $Idea->title;
    Severity: Major
    Found in lib/Users/Timeline/Utility/ObjectTitle.php and 3 other locations - About 40 mins to fix
    lib/Users/Timeline/Utility/ObjectTitle.php on lines 135..135
    lib/Users/Timeline/Utility/ObjectTitle.php on lines 153..153
    lib/Users/Timeline/Utility/ObjectTitle.php on lines 167..167

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

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

                self::$row['meta']['object']['title'] = $Loco->number;
    Severity: Major
    Found in lib/Users/Timeline/Utility/ObjectTitle.php and 3 other locations - About 40 mins to fix
    lib/Users/Timeline/Utility/ObjectTitle.php on lines 153..153
    lib/Users/Timeline/Utility/ObjectTitle.php on lines 167..167
    lib/Users/Timeline/Utility/ObjectTitle.php on lines 232..232

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

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

            self::$row['meta']['object']['title'] = $Location->name;
    Severity: Major
    Found in lib/Users/Timeline/Utility/ObjectTitle.php and 3 other locations - About 40 mins to fix
    lib/Users/Timeline/Utility/ObjectTitle.php on lines 135..135
    lib/Users/Timeline/Utility/ObjectTitle.php on lines 153..153
    lib/Users/Timeline/Utility/ObjectTitle.php on lines 232..232

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

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

            self::$row['meta']['object']['title'] = $LocoClass->name;
    Severity: Major
    Found in lib/Users/Timeline/Utility/ObjectTitle.php and 3 other locations - About 40 mins to fix
    lib/Users/Timeline/Utility/ObjectTitle.php on lines 135..135
    lib/Users/Timeline/Utility/ObjectTitle.php on lines 167..167
    lib/Users/Timeline/Utility/ObjectTitle.php on lines 232..232

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

    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

            } elseif (count(self::$row['args']['locos']) === 2) {
                self::$row['meta']['object']['title'] = self::$row['args']['locos'][key(self::$row['args']['locos'])]['Locomotive'];
                next(self::$row['args']['locos']);
                
                self::$row['meta']['object']['title'] .= " and " . self::$row['args']['locos'][key(self::$row['args']['locos'])]['Locomotive'];
    Severity: Minor
    Found in lib/Users/Timeline/Utility/ObjectTitle.php and 1 other location - About 40 mins to fix
    lib/Users/Timeline/Utility/ObjectTitle.php on lines 205..221

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

    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 (count(self::$row['args']['locos']) === 1) {
                self::$row['meta']['object']['title'] = self::$row['args']['locos'][key(self::$row['args']['locos'])]['Locomotive'];
            } elseif (count(self::$row['args']['locos']) === 2) {
                self::$row['meta']['object']['title'] = self::$row['args']['locos'][key(self::$row['args']['locos'])]['Locomotive'];
                next(self::$row['args']['locos']);
    Severity: Minor
    Found in lib/Users/Timeline/Utility/ObjectTitle.php and 1 other location - About 40 mins to fix
    lib/Users/Timeline/Utility/ObjectTitle.php on lines 207..212

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

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

            $Idea = new Idea(self::$row['value']);
    Severity: Minor
    Found in lib/Users/Timeline/Utility/ObjectTitle.php and 2 other locations - About 30 mins to fix
    lib/Users/Timeline/Utility/ObjectTitle.php on lines 112..112
    lib/Users/Timeline/Utility/ObjectTitle.php on lines 166..166

    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

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

            $Location = new Location(self::$row['value']);
    Severity: Minor
    Found in lib/Users/Timeline/Utility/ObjectTitle.php and 2 other locations - About 30 mins to fix
    lib/Users/Timeline/Utility/ObjectTitle.php on lines 112..112
    lib/Users/Timeline/Utility/ObjectTitle.php on lines 231..231

    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

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

            $Post = new Post(self::$row['value']);
    Severity: Minor
    Found in lib/Users/Timeline/Utility/ObjectTitle.php and 2 other locations - About 30 mins to fix
    lib/Users/Timeline/Utility/ObjectTitle.php on lines 166..166
    lib/Users/Timeline/Utility/ObjectTitle.php on lines 231..231

    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

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

            $LocoClass = LocosFactory::CreateLocoClass(self::$row['value']); 
    Severity: Minor
    Found in lib/Users/Timeline/Utility/ObjectTitle.php and 1 other location - About 30 mins to fix
    lib/Users/Timeline/Utility/ObjectTitle.php on lines 123..123

    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

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

            $Loco = LocosFactory::CreateLocomotive(self::$row['value']); 
    Severity: Minor
    Found in lib/Users/Timeline/Utility/ObjectTitle.php and 1 other location - About 30 mins to fix
    lib/Users/Timeline/Utility/ObjectTitle.php on lines 147..147

    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

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

            self::$row['meta']['url'] = $Location->url;
    Severity: Major
    Found in lib/Users/Timeline/Utility/ObjectTitle.php and 5 other locations - About 30 mins to fix
    lib/Users/Timeline/Utility/ObjectTitle.php on lines 129..129
    lib/Users/Timeline/Utility/ObjectTitle.php on lines 130..130
    lib/Users/Timeline/Utility/ObjectTitle.php on lines 155..155
    lib/Users/Timeline/Utility/ObjectTitle.php on lines 156..156
    lib/Users/Timeline/Utility/ObjectTitle.php on lines 233..233

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

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

            self::$row['meta']['id'] = $Loco->id;
    Severity: Major
    Found in lib/Users/Timeline/Utility/ObjectTitle.php and 5 other locations - About 30 mins to fix
    lib/Users/Timeline/Utility/ObjectTitle.php on lines 129..129
    lib/Users/Timeline/Utility/ObjectTitle.php on lines 155..155
    lib/Users/Timeline/Utility/ObjectTitle.php on lines 156..156
    lib/Users/Timeline/Utility/ObjectTitle.php on lines 168..168
    lib/Users/Timeline/Utility/ObjectTitle.php on lines 233..233

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

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

            self::$row['meta']['url'] = $Idea->url;
    Severity: Major
    Found in lib/Users/Timeline/Utility/ObjectTitle.php and 5 other locations - About 30 mins to fix
    lib/Users/Timeline/Utility/ObjectTitle.php on lines 129..129
    lib/Users/Timeline/Utility/ObjectTitle.php on lines 130..130
    lib/Users/Timeline/Utility/ObjectTitle.php on lines 155..155
    lib/Users/Timeline/Utility/ObjectTitle.php on lines 156..156
    lib/Users/Timeline/Utility/ObjectTitle.php on lines 168..168

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

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

            self::$row['meta']['namespace'] = $LocoClass->namespace;
    Severity: Major
    Found in lib/Users/Timeline/Utility/ObjectTitle.php and 5 other locations - About 30 mins to fix
    lib/Users/Timeline/Utility/ObjectTitle.php on lines 129..129
    lib/Users/Timeline/Utility/ObjectTitle.php on lines 130..130
    lib/Users/Timeline/Utility/ObjectTitle.php on lines 156..156
    lib/Users/Timeline/Utility/ObjectTitle.php on lines 168..168
    lib/Users/Timeline/Utility/ObjectTitle.php on lines 233..233

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

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

            self::$row['meta']['namespace'] = $Loco->namespace;
    Severity: Major
    Found in lib/Users/Timeline/Utility/ObjectTitle.php and 5 other locations - About 30 mins to fix
    lib/Users/Timeline/Utility/ObjectTitle.php on lines 130..130
    lib/Users/Timeline/Utility/ObjectTitle.php on lines 155..155
    lib/Users/Timeline/Utility/ObjectTitle.php on lines 156..156
    lib/Users/Timeline/Utility/ObjectTitle.php on lines 168..168
    lib/Users/Timeline/Utility/ObjectTitle.php on lines 233..233

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

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

            self::$row['meta']['id'] = $LocoClass->id;
    Severity: Major
    Found in lib/Users/Timeline/Utility/ObjectTitle.php and 5 other locations - About 30 mins to fix
    lib/Users/Timeline/Utility/ObjectTitle.php on lines 129..129
    lib/Users/Timeline/Utility/ObjectTitle.php on lines 130..130
    lib/Users/Timeline/Utility/ObjectTitle.php on lines 155..155
    lib/Users/Timeline/Utility/ObjectTitle.php on lines 168..168
    lib/Users/Timeline/Utility/ObjectTitle.php on lines 233..233

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

    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

        }

    There are no issues that match your filters.

    Category
    Status