Skip to content

Begin refactoring Node model for better maintainability #2652

Open
@jywarren

Description

@jywarren

Please describe the problem (or idea)

CodeClimate gives us a "C" rating -- see the README at https://github.com/publiclab/plots2

The full report is here: https://codeclimate.com/github/publiclab/plots2

The two biggest "smells" as they call them, are overcomplexity and length of node.rb: https://github.com/publiclab/plots2/blob/master/app/models/node.rb

Can we break some of these methods up or clean them up or DRY them up?

Could we break this into subclasses like Wiki and Note and Feature and Map, that inherit from Node? How would that work?

Could we move stats-related methods into a subclass model called Stats or something? like self.weekly_tallies

Just collecting some ideas here! Chime in!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Rubybreak-me-upbreak up for cleaner code separation, discrete tests, and, easier and iterative collaborationenhancementexplains that the issue is to improve upon one of our existing featureshelp wantedrequires help by anyone willing to contributemore-detail-pleaseissue lacks proper description and perhaps needs code links or the location of the problem

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions