Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove circular dependencies in ProductOpener modules #622

Open
stephanegigandet opened this issue Jan 17, 2017 · 3 comments
Open

Remove circular dependencies in ProductOpener modules #622

stephanegigandet opened this issue Jan 17, 2017 · 3 comments
Labels
🐛 bug This is a bug, not a feature request. ⭐ 🐛 top bug Top bug. ⭐ top issue Top issue. ✅ Task
Milestone

Comments

@stephanegigandet
Copy link
Contributor

stephanegigandet commented Jan 17, 2017

What

  • e.g. in Food.pm : use ProductOpener::Tags qw/:all/;
  • in Tags.pm : use ProductOpener::Food qw/:all/;
  • This can cause strange bugs depending on the order of the use clauses, modules initialized multiple times etc.
  • We need to create a graph of the uses in Product Opener modules, and find ways to remove cycles.

Part of

@teolemon teolemon added this to the Code Health milestone Jan 22, 2017
@hangy hangy added the task label Feb 12, 2017
@hangy
Copy link
Member

hangy commented Feb 12, 2017

Meh, I tried graphing the dependencies with App:PrereqGrapher, but apparently it fails when I set depth to anything higher than 1 (when analyzing Display.pm) or if I try to analyze all of our *.pm files with a wildcard. I suppose it could just abort because of the circular dependency we want to avoid. 😆

@teolemon teolemon added the 🐛 bug This is a bug, not a feature request. label May 3, 2017
@hangy
Copy link
Member

hangy commented Feb 16, 2019

I built this graph based on 501837d and the curent use statements, without testing whether any subs or variables are actually used: https://hangy.de/off/dependencies2.svg

GraphViz

digraph g{
  rankdir=LR;
  "ProductOpener::Cache" -> "ProductOpener::Store";
  "ProductOpener::Cache" -> "ProductOpener::Config";

  "ProductOpener::Config" -> "ProductOpener::Config2";

  "ProductOpener::Data" -> "ProductOpener::Config";

  "ProductOpener::Display" -> "ProductOpener::Store";
  "ProductOpener::Display" -> "ProductOpener::Config";
  "ProductOpener::Display" -> "ProductOpener::Tags";
  "ProductOpener::Display" -> "ProductOpener::TagsEntries";
  "ProductOpener::Display" -> "ProductOpener::Users";
  "ProductOpener::Display" -> "ProductOpener::Index";
  "ProductOpener::Display" -> "ProductOpener::Cache";
  "ProductOpener::Display" -> "ProductOpener::Lang";
  "ProductOpener::Display" -> "ProductOpener::Images";
  "ProductOpener::Display" -> "ProductOpener::Food";
  "ProductOpener::Display" -> "ProductOpener::Ingredients";
  "ProductOpener::Display" -> "ProductOpener::Products";
  "ProductOpener::Display" -> "ProductOpener::Missions";
  "ProductOpener::Display" -> "ProductOpener::MissionsConfig";
  "ProductOpener::Display" -> "ProductOpener::URL";
  "ProductOpener::Display" -> "ProductOpener::Data";

  "ProductOpener::Food" -> "ProductOpener::Store";
  "ProductOpener::Food" -> "ProductOpener::Config";
  "ProductOpener::Food" -> "ProductOpener::Lang";
  "ProductOpener::Food" -> "ProductOpener::Tags";

  "ProductOpener::Images" -> "ProductOpener::Store";
  "ProductOpener::Images" -> "ProductOpener::Config";
  "ProductOpener::Images" -> "ProductOpener::Products";
  "ProductOpener::Images" -> "ProductOpener::Lang";
  "ProductOpener::Images" -> "ProductOpener::Display";
  "ProductOpener::Images" -> "ProductOpener::URL";

  "ProductOpener::Import" -> "ProductOpener::Config";
  "ProductOpener::Import" -> "ProductOpener::Store";
  "ProductOpener::Import" -> "ProductOpener::Tags";

  "ProductOpener::Index" -> "ProductOpener::Config";
  "ProductOpener::Index" -> "ProductOpener::Store";
  "ProductOpener::Index" -> "ProductOpener::Tags";
  "ProductOpener::Index" -> "ProductOpener::Users";

  "ProductOpener::Ingredients" -> "ProductOpener::Store";
  "ProductOpener::Ingredients" -> "ProductOpener::Config";
  "ProductOpener::Ingredients" -> "ProductOpener::Users";
  "ProductOpener::Ingredients" -> "ProductOpener::Products";
  "ProductOpener::Ingredients" -> "ProductOpener::TagsEntries";
  "ProductOpener::Ingredients" -> "ProductOpener::Tags";
  "ProductOpener::Ingredients" -> "ProductOpener::URL";

  "ProductOpener::Lang" -> "ProductOpener::I18N";
  "ProductOpener::Lang" -> "ProductOpener::Config";
  "ProductOpener::Lang" -> "ProductOpener::Store";

  "ProductOpener::Mail" -> "ProductOpener::Store";
  "ProductOpener::Mail" -> "ProductOpener::Config";
  "ProductOpener::Mail" -> "ProductOpener::Lang";

  "ProductOpener::Missions" -> "ProductOpener::Store";
  "ProductOpener::Missions" -> "ProductOpener::Config";
  "ProductOpener::Missions" -> "ProductOpener::Users";
  "ProductOpener::Missions" -> "ProductOpener::Products";
  "ProductOpener::Missions" -> "ProductOpener::Display";
  "ProductOpener::Missions" -> "ProductOpener::MissionsConfig";
  "ProductOpener::Missions" -> "ProductOpener::Lang";
  "ProductOpener::Missions" -> "ProductOpener::Tags";

  "ProductOpener::MissionsConfig" -> "ProductOpener::Store";
  "ProductOpener::MissionsConfig" -> "ProductOpener::Config";
  "ProductOpener::MissionsConfig" -> "ProductOpener::Users";
  "ProductOpener::MissionsConfig" -> "ProductOpener::Products";
  "ProductOpener::MissionsConfig" -> "ProductOpener::Lang";

  "ProductOpener::Products" -> "ProductOpener::Store";
  "ProductOpener::Products" -> "ProductOpener::Config";
  "ProductOpener::Products" -> "ProductOpener::Users";
  "ProductOpener::Products" -> "ProductOpener::Display";
  "ProductOpener::Products" -> "ProductOpener::Lang";
  "ProductOpener::Products" -> "ProductOpener::Food";
  "ProductOpener::Products" -> "ProductOpener::Tags";
  "ProductOpener::Products" -> "ProductOpener::Mail";
  "ProductOpener::Products" -> "ProductOpener::URL";
  "ProductOpener::Products" -> "ProductOpener::Data";

  "ProductOpener::SiteQuality" -> "ProductOpener::Store";
  "ProductOpener::SiteQuality" -> "ProductOpener::Tags";

  "ProductOpener::Tags" -> "ProductOpener::Store";
  "ProductOpener::Tags" -> "ProductOpener::Config";
  "ProductOpener::Tags" -> "ProductOpener::TagsEntries";
  "ProductOpener::Tags" -> "ProductOpener::Food";
  "ProductOpener::Tags" -> "ProductOpener::Lang";
  "ProductOpener::Tags" -> "ProductOpener::Text";

  "ProductOpener::URL" -> "ProductOpener::Config";

  "ProductOpener::Users" -> "ProductOpener::Store";
  "ProductOpener::Users" -> "ProductOpener::Config";
  "ProductOpener::Users" -> "ProductOpener::Mail";
  "ProductOpener::Users" -> "ProductOpener::Lang";
  "ProductOpener::Users" -> "ProductOpener::Cache";
  "ProductOpener::Users" -> "ProductOpener::Display";
}

@stephanegigandet
Copy link
Contributor Author

@hangy : I had missed the graph, wow. I did make quite a mess.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug This is a bug, not a feature request. ⭐ 🐛 top bug Top bug. ⭐ top issue Top issue. ✅ Task
Projects
Status: To discuss and validate
Development

No branches or pull requests

3 participants