Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Lord of the Code Smells in Padrino

Lord of the Code Smells in Padrino

As long as your application exists and developers will leave and new ones will take apart in your team. It's good to have some metrics about certain code smell. A code smells are part of your source code which may be the root of a design problem but are no actually bug. It's good to have some tools to be "lord of the smells" for http://www.padrinorb.com - don't let smells lower the quality of your project.

You can find code examples and how set up the metrics under http://wikimatze.de/code-coverage-tools-for-padrino/

Matthias Günther

January 09, 2015
Tweet

More Decks by Matthias Günther

Other Decks in Technology

Transcript

  1. Lord of Code Smells in Padrino Powered by Rabbit 2.1.3
    Lord of Code
    Smells in
    Padrino

    View Slide

  2. Lord of Code Smells in Padrino Powered by Rabbit 2.1.3
    “Musik”

    View Slide

  3. Lord of Code Smells in Padrino Powered by Rabbit 2.1.3
    Who Am I
    @wikimatze
    Running vimberlin.de
    Writing padrinobook.com

    View Slide

  4. Lord of Code Smells in Padrino Powered by Rabbit 2.1.3
    Code Smell
    any symptom in the source
    code of a program that
    possibly indicates a deeper
    problem

    View Slide

  5. Lord of Code Smells in Padrino Powered by Rabbit 2.1.3
    Tools
    simplecov: Uses Rubies
    1.9’s built-in Coverage
    library
    metric_fu: Creates churn,
    flog, flay …
    codeclimate.com: Online
    tool – hurray

    View Slide

  6. Lord of Code Smells in Padrino Powered by Rabbit 2.1.3
    Simplecov

    View Slide

  7. Lord of Code Smells in Padrino Powered by Rabbit 2.1.3
    metric_fu
    uses several other gems to
    create graphical output

    View Slide

  8. Lord of Code Smells in Padrino Powered by Rabbit 2.1.3
    Cane
    are certain code quality
    thresholds are met like line
    length, documentation
    ABC complexity
    aggregates the number of
    assignments, branches,
    and conditionals in a unit

    View Slide

  9. Lord of Code Smells in Padrino Powered by Rabbit 2.1.3
    Cane Image

    View Slide

  10. Lord of Code Smells in Padrino Powered by Rabbit 2.1.3
    Churn
    measures the change ratio
    of files

    View Slide

  11. Lord of Code Smells in Padrino Powered by Rabbit 2.1.3
    Churn Image

    View Slide

  12. Lord of Code Smells in Padrino Powered by Rabbit 2.1.3
    Flog
    flog score measures
    complexity
    a score of above 20 may
    need refactoring
    if it is 60 …

    View Slide

  13. Lord of Code Smells in Padrino Powered by Rabbit 2.1.3
    Chaos image

    View Slide

  14. Lord of Code Smells in Padrino Powered by Rabbit 2.1.3
    Flog Image

    View Slide

  15. Lord of Code Smells in Padrino Powered by Rabbit 2.1.3
    Flay
    analyzes code similarities
    hell it’s just a DRY indicator
    code that is too DRY can
    become “chafe”

    View Slide

  16. Lord of Code Smells in Padrino Powered by Rabbit 2.1.3
    Flay image

    View Slide

  17. Lord of Code Smells in Padrino Powered by Rabbit 2.1.3
    Reek
    checks a bunch of code
    smells like control couple,
    large class, long
    parameters list, nested
    iterators, …

    View Slide

  18. Lord of Code Smells in Padrino Powered by Rabbit 2.1.3
    Reek image

    View Slide

  19. Lord of Code Smells in Padrino Powered by Rabbit 2.1.3
    Roodi
    Ruby Object Oriented
    Design Inferometer
    informs you about design
    issues

    View Slide

  20. Lord of Code Smells in Padrino Powered by Rabbit 2.1.3
    Rood image

    View Slide

  21. Lord of Code Smells in Padrino Powered by Rabbit 2.1.3
    Saikuro
    generates a list of
    cyclomatic complexity of
    each method

    View Slide

  22. Lord of Code Smells in Padrino Powered by Rabbit 2.1.3
    Saikuro image

    View Slide

  23. Lord of Code Smells in Padrino Powered by Rabbit 2.1.3
    Hotspot
    gathering of the flog, flay
    and reek score

    View Slide

  24. Lord of Code Smells in Padrino Powered by Rabbit 2.1.3
    Hotspot image

    View Slide

  25. Lord of Code Smells in Padrino Powered by Rabbit 2.1.3
    Me again
    @wikimatze
    code examples
    wikimatze.de/code-
    coverage-tools-for-padrino/
    Book preview
    padrinobook.com/book

    View Slide

  26. Lord of Code Smells in Padrino Powered by Rabbit 2.1.3
    Redesigning padrinorb
    page

    View Slide