Examples
Return every node
Project: Docker ComposeThe more relationships a node has, the bigger it's represented.
GRAPH.QUERY "compose" "MATCH (n) RETURN n"
![](/static/69b04a73c171e63782476e071653d4a0/afa5c/docker_compose_all_in.png)
The biggest nodes are: compose.config.config, tests.integration.service_test.ServiceTest, tests.helpers.build_config_details
Return every non-test object
Project: Docker ComposeGRAPH.QUERY "compose" "MATCH (n {is_test_object: False}) RETURN n"
![](/static/ea6b29db4168f27fb3786b7c61bdcef0/afa5c/docker_compose_all_in_production_code.png)
up: the function behind the docker-compose up command
Project: Docker ComposeA query returning exactly one node using the unique full_name property. Double-click on the node to display all its relationships.
GRAPH.QUERY "compose" "MATCH (up: function {full_name: 'compose.cli.main.TopLevelCommand.up'}) RETURN up"
![](/static/1731a64db5ee65857061f047cac61faa/afa5c/docker_compose_up.png)
up and its calls relationships
Project: Docker ComposeGRAPH.QUERY "compose" "MATCH (f: function {full_name: 'compose.cli.main.TopLevelCommand.up'}) - [c: calls] -> (n) RETURN f, n"
![](/static/08a64b500d6f565e582c677524c47d46/afa5c/docker_compose_up_calls.png)
up and its calls relationships excluding calls to self
Project: Docker ComposeGRAPH.QUERY "compose" "MATCH (f: function {full_name: 'compose.cli.main.TopLevelCommand.up'}) - [c: calls] -> (n) WHERE c.reference_name <> 'self' RETURN f, n"
![](/static/4316c274949b8dfaad75d3d980c6b92d/afa5c/docker_compose_up_calls_without_self.png)
up calls and where are those called functions located
Project: Docker ComposeWhich functions and classes does compose.cli.main.TopLevelCommand.up call and where are they located? Calls within the class TopLevelCommand are excluded.
GRAPH.QUERY "compose" "MATCH (up: function {full_name: 'compose.cli.main.TopLevelCommand.up'}) - [c: calls] -> (n) <- [c2: contains] - (owner) WHERE c.reference_name <> 'self' RETURN up, n, owner"
![](/static/117c8c9f9e3afc6ecbc75b212f288f75/afa5c/up_calling_functions_and_where.png)
up is mainly calling functions located in its own module compose.cli.main
The most often called function
Project: Docker ComposeGRAPH.QUERY "compose" "MATCH (x) - [c:calls] -> (n:function) RETURN n, COUNT(x) as call_count ORDER BY call_count desc"
![](/static/4ef8a979bf7f7c34444ac40fbad5ef2e/afa5c/docker_compose_most_often_called_function.png)
compose.config.load: 162, compose.project.Project.from_config: 71, compose.config.config.merge_service_dicts: 61
Functions calling compose.config.config.load
Project: Docker ComposeGRAPH.QUERY "compose" "MATCH (x) - [c:calls] -> (n:function {full_name: 'compose.config.config.load'}) RETURN x"
![](/static/76a84dc01945702143cfb0391ff053a1/afa5c/docker_compose_calls_to_config_load.png)
162 calls: 155 test functions, 5 test helper functions, 2 functions from the production code.
Testing styles: unittest vs pytest
Project: Docker ComposeWhere are the test functions located? In classes or in modules directly?
GRAPH.QUERY "compose" "MATCH (t) - [c: contains] -> (tf: test_function) RETURN t, tf"
83 test classes, 5 modules containing directly a test function.
Test functions calling each other
Project: Docker ComposeGRAPH.QUERY "compose" "MATCH (tf: test_function) - [c: calls] -> (other_tf: test_function) RETURN tf, other_tf"
![](/static/a0744b3ee91aef634a36c4dab89df382/afa5c/docker_compose_test_functions_calling_each_other.png)
1 such case found: tests.acceptance.cli_test.CLITestCase.test_build_log_level -> tests.acceptance.cli_test.CLITestCase.test_env_file_relative_to_compose_file
Function calls in and between packages
Project: Docker ComposeGRAPH.QUERY "compose" "MATCH (called_package: package) - [:contains*] -> (f: function) <- [:calls] - (caller: function) <- [:contains*] (caller_package: package) RETURN caller_package, called_package, count(f) as call_count ORDER BY call_count desc"
compose => compose: 372, compose.config => compose.config: 192, compose.cli => compose.cli: 147, compose.cli => compose.config: 13, compose.config => compose: 12
Function calls only between packages
Project: Docker ComposeGRAPH.QUERY "compose" "MATCH (called_package: package) - [:contains*] -> (f: function) <- [:calls] - (caller: function) <- [:contains*] (caller_package: package) WHERE (caller_package.full_name <> called_package.full_name) RETURN caller_package, called_package, count(f) as call_count ORDER BY call_count desc"
compose.cli => compose.config: 13, compose.config => compose: 12, compose => compose.config: 10, compose.cli => compose: 6, compose => compose.cli: 2
Calls to cli from other packages
Project: Docker ComposeGRAPH.QUERY "compose" "MATCH (called_package: package {full_name: 'compose.cli'}) - [:contains*] -> (f: function) <- [:calls] - (caller: function) <- [:contains*] - (caller_package: package) WHERE (caller_package.full_name <> called_package.full_name) RETURN f, caller_package, caller"
![](/static/f5e6381ea6d47dcbbde4dbc55c3666b9/afa5c/docker_compose_calls_to_cli_from_other_packages.png)
2 such cases found, both for compose.cli.utils.binarystr_to_unicode: compose.service.Service.create_container, compose.service.Service.start_container
build vs run
Project: Docker ComposeFunctions called by the Docker Compose top level commands build and run
GRAPH.QUERY "compose" "MATCH (command: function) - [c: calls] -> (n) <- [c2: contains] - (owner) WHERE command.full_name in ['compose.cli.main.TopLevelCommand.build', 'compose.cli.main.TopLevelCommand.run'] RETURN command, n, owner"
![](/static/c246d664b7b4f8ba8b34380b706b2329/afa5c/docker_compose_build_vs_run.png)
Integration test package overview
Project: Docker ComposeGRAPH.QUERY "compose" "MATCH (tm: test_module) - [c: contains] -> (n) WHERE (tm.test_type='integration') RETURN tm, n"
![](/static/5dad44a91b0b3a1256e3b5a4e9c90539/afa5c/docker_compose_integration_tests_overview.png)
Test functions calling a helper from another test type
Project: Docker ComposeGRAPH.QUERY "compose" "MATCH (tf: test_function) - [c:calls] -> (th: test_helper_function) WHERE (tf.test_type <> th.test_type and th.test_type <> '') RETURN tf, th"
![](/static/51a4b01d2c888d7b7462074bd30302ff/afa5c/docker_compose_test_functions_calling_helper_from_other_test_type.png)
up vs down
Project: Docker ComposeFunctions called by the Docker Compose top level commands up and down
GRAPH.QUERY "compose" "MATCH (command: function) - [c: calls] -> (n) <- [c2: contains] - (owner) WHERE command.full_name in ['compose.cli.main.TopLevelCommand.up', 'compose.cli.main.TopLevelCommand.down'] RETURN command, n, owner"
![](/static/2b9de7e1734307be9c3de6c2441e943f/afa5c/docker_compose_up_vs_down.png)
down calls a small subset of functions up is calling plus compose.cli.main.image_type_from_opt
up vs run
Project: Docker ComposeFunctions called by the Docker Compose top level commands up and run
GRAPH.QUERY "compose" "MATCH (command: function) - [c: calls] -> (n) <- [c2: contains] - (owner) WHERE command.full_name in ['compose.cli.main.TopLevelCommand.up', 'compose.cli.main.TopLevelCommand.run'] RETURN command, n, owner"
![](/static/ef4868dfc9f1d7604effbdd1aa422cd4/afa5c/docker_compose_up_vs_run.png)
run calls a small subset of functions up is calling plus compose.cli.main.build_one_off_container_options and compose.cli.main.run_one_off_container