refactorguide package¶
Submodules¶
refactorguide.cli module¶
Console script for refactorguide.
refactorguide.desgin module¶
refactorguide.design_parser module¶
refactorguide.formatters module¶
-
refactorguide.formatters.dependencies_tree(module_dict: Dict[str, Dict[str, List[refactorguide.models.Class]]], oneline_format='{full_name}') → str[source]¶
refactorguide.hierarchy module¶
-
refactorguide.hierarchy.build_hierarchy(classes: List[refactorguide.models.Class], layer_designs: Dict[str, List[Dict[str, str]]])[source]¶
-
refactorguide.hierarchy.filter_hierarchy(container: refactorguide.models.ComponentList, path_patterns: Dict[str, str], hierarchy: refactorguide.models.Hierarchy) → refactorguide.models.Hierarchy[source]¶
refactorguide.input_idea module¶
-
refactorguide.input_idea.read_file(idea_dep_file_path) → List[refactorguide.models.Class][source]¶
refactorguide.models module¶
-
class
refactorguide.models.Class(path, name, package, module, layer=None, dependencies=[])[source]¶ Bases:
refactorguide.models.ClassInfo,refactorguide.models.Component-
property
dependencies¶ all dependencies of the component in order.
-
property
usages¶ all usages of the component in order.
-
property
-
class
refactorguide.models.ClassInfo(path: str, name: str, package: str, module: str, layer: str)[source]¶ Bases:
objectInformation of a class.
-
property
full_name¶ includes both package and name
-
property
hierarchy_path¶
-
is_layer(layer) → bool[source]¶ Check whether class belongs to specfic layer.
- Parameters
layer – layer’s name
- Returns
True if class belongs to layer
-
property
is_production¶ True if the class is production code
-
property
-
class
refactorguide.models.Component[source]¶ Bases:
objectA component is something that has dependencies and usages, such as class, package, module and layer.
-
abstract property
dependencies¶ all dependencies of the component in order.
-
abstract property
hierarchy_path¶ path of the component in the hierarchy
-
property
smell_dependencies¶ all smell dependencies of component in order.
-
property
smell_usages¶ all smell usages of the component in order.
-
abstract property
usages¶ all usages of the component in order.
-
abstract property
-
class
refactorguide.models.ComponentList(name, parent=None)[source]¶ Bases:
refactorguide.models.Component-
property
classes¶
-
property
dependencies¶ all dependencies of the component in order.
-
abstract property
item_type¶
-
property
items¶
-
property
smell_dependency_classes¶
-
property
smell_uasge_classes¶
-
property
usages¶ all usages of the component in order.
-
property
-
class
refactorguide.models.Dependency(path: str, name: str, package: str, module: str, layer: str)[source]¶ Bases:
refactorguide.models.ClassInfo-
property
has_smell¶
-
property
-
class
refactorguide.models.Hierarchy(layers: List[refactorguide.models.Layer] = [], **_)[source]¶ Bases:
refactorguide.models.ComponentList-
property
hierarchy_path¶ path of the component in the hierarchy
-
property
item_type¶
-
property
layers¶
-
property
modules¶
-
property
packages¶
-
property
-
class
refactorguide.models.Layer(name: str, modules: List[refactorguide.models.Module] = [], **kwargs)[source]¶ Bases:
refactorguide.models.ComponentList-
property
hierarchy_path¶ path of the component in the hierarchy
-
property
item_type¶
-
property
layer¶
-
property
modules¶
-
property
packages¶
-
property
-
class
refactorguide.models.Module(name: str, packages: List[refactorguide.models.Package] = [], layer: Optional[str] = None, **_)[source]¶ Bases:
refactorguide.models.ComponentList-
property
hierarchy_path¶ path of the component in the hierarchy
-
property
item_type¶
-
property
layer¶
-
property
module¶
-
property
packages¶
-
property
-
class
refactorguide.models.Package(name, classes=[], module=None, layer=None, **_)[source]¶ Bases:
refactorguide.models.ComponentList-
property
all_attributes¶
-
property
classes¶
-
property
hierarchy_path¶ path of the component in the hierarchy
-
property
item_type¶
-
property
module¶
-
property
package¶
-
property
-
refactorguide.models.group_class_by_module_package(classes: List[refactorguide.models.Class]) → Dict[str, Dict[str, refactorguide.models.Class]][source]¶ Group class by its attributes: ‘module’, ‘pacakge’ and ‘name’, returns an embeded dict
refactorguide.output_md module¶
-
refactorguide.output_md.write_files(report_dir, hierarchy: refactorguide.models.Hierarchy)[source]¶
refactorguide.output_uml module¶
-
refactorguide.output_uml.write_files(report_dir, hierarchy: refactorguide.models.Hierarchy)[source]¶
refactorguide.smells module¶
-
class
refactorguide.smells.SmellAddOnDependency(**kwargs)[source]¶ Bases:
refactorguide.smells.Smell-
property
all_args¶
-
property
-
class
refactorguide.smells.SmellCylicDependency[source]¶ Bases:
refactorguide.smells.Smell
-
class
refactorguide.smells.SmellDependency(**kwargs)[source]¶ Bases:
refactorguide.smells.Smell-
property
all_args¶
-
property
-
class
refactorguide.smells.SmellDependencyCrossModule[source]¶ Bases:
refactorguide.smells.Smell
-
class
refactorguide.smells.SmellDependencyCrossPackage[source]¶ Bases:
refactorguide.smells.Smell
-
refactorguide.smells.cross_module(hierachy, cls: refactorguide.models.Class, dep: refactorguide.models.Class) → bool[source]¶
-
refactorguide.smells.find_smells(hierarchy: refactorguide.models.Hierarchy, dependency_smells)[source]¶
refactorguide.statistics module¶
-
refactorguide.statistics.components_statistics(components: List[refactorguide.models.Component])[source]¶
-
refactorguide.statistics.dependencies_statistics(dependency_group: Dict[refactorguide.models.Dependency, List[Tuple[refactorguide.smells.Smell, refactorguide.models.Dependency, refactorguide.models.Class]]])[source]¶
-
refactorguide.statistics.group_classes_by_smell_dependency(classes: List[refactorguide.models.Class]) → Dict[refactorguide.smells.Smell, Dict[refactorguide.models.Dependency, List[Tuple[refactorguide.smells.Smell, refactorguide.models.Dependency, refactorguide.models.Class]]]][source]¶
-
refactorguide.statistics.smell_data_frame(classes: List[refactorguide.models.Class])[source]¶
-
refactorguide.statistics.smells_statistics(smell_group: Dict[refactorguide.smells.Smell, Dict[refactorguide.models.Dependency, List[Tuple[refactorguide.smells.Smell, refactorguide.models.Dependency, refactorguide.models.Class]]]])[source]¶
Module contents¶
Top-level package for Refactor Guide.