summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDimitri van Heesch <doxygen@gmail.com>2019-11-16 14:49:20 (GMT)
committerDimitri van Heesch <doxygen@gmail.com>2019-11-16 14:49:20 (GMT)
commit7acba2f316a6e8f02364d76ab96b7ff9e739aec1 (patch)
treee32f6e68ecdecedc574a9382aef37f1db02c382e /src
parente43827ff91188fa49feec5ba5e5f4cbd825b164f (diff)
downloadDoxygen-7acba2f316a6e8f02364d76ab96b7ff9e739aec1.zip
Doxygen-7acba2f316a6e8f02364d76ab96b7ff9e739aec1.tar.gz
Doxygen-7acba2f316a6e8f02364d76ab96b7ff9e739aec1.tar.bz2
issue #7348 Better warning in case a graph would have been to large
Diffstat (limited to 'src')
-rw-r--r--src/classdef.cpp3
-rw-r--r--src/dotcallgraph.cpp9
-rw-r--r--src/dotcallgraph.h1
-rw-r--r--src/dotclassgraph.cpp7
-rw-r--r--src/dotclassgraph.h1
-rw-r--r--src/dotincldepgraph.cpp8
-rw-r--r--src/dotincldepgraph.h1
-rw-r--r--src/filedef.cpp6
-rw-r--r--src/memberdef.cpp6
9 files changed, 32 insertions, 10 deletions
diff --git a/src/classdef.cpp b/src/classdef.cpp
index cee8be9..fd24f0b 100644
--- a/src/classdef.cpp
+++ b/src/classdef.cpp
@@ -1706,7 +1706,8 @@ void ClassDefImpl::writeInheritanceGraph(OutputList &ol) const
DotClassGraph inheritanceGraph(this,Inheritance);
if (inheritanceGraph.isTooBig())
{
- warn_uncond("Inheritance graph for '%s' not generated, too many nodes. Consider increasing DOT_GRAPH_MAX_NODES.\n",name().data());
+ warn_uncond("Inheritance graph for '%s' not generated, too many nodes (%d), threshold is %d. Consider increasing DOT_GRAPH_MAX_NODES.\n",
+ name().data(), inheritanceGraph.numNodes(), Config_getInt(DOT_GRAPH_MAX_NODES));
}
else if (!inheritanceGraph.isTrivial())
{
diff --git a/src/dotcallgraph.cpp b/src/dotcallgraph.cpp
index 15d408a..b024f09 100644
--- a/src/dotcallgraph.cpp
+++ b/src/dotcallgraph.cpp
@@ -212,6 +212,11 @@ bool DotCallGraph::isTrivial() const
bool DotCallGraph::isTooBig() const
{
- int numNodes = m_startNode->children() ? m_startNode->children()->count() : 0;
- return numNodes>=DOT_GRAPH_MAX_NODES;
+ return numNodes()>=DOT_GRAPH_MAX_NODES;
}
+
+int DotCallGraph::numNodes() const
+{
+ return m_startNode->children() ? m_startNode->children()->count() : 0;
+}
+
diff --git a/src/dotcallgraph.h b/src/dotcallgraph.h
index c96b9cf..bba976c 100644
--- a/src/dotcallgraph.h
+++ b/src/dotcallgraph.h
@@ -28,6 +28,7 @@ class DotCallGraph : public DotGraph
~DotCallGraph();
bool isTrivial() const;
bool isTooBig() const;
+ int numNodes() const;
QCString writeGraph(FTextStream &t, GraphOutputFormat gf, EmbeddedOutputFormat ef,
const char *path,const char *fileName,
const char *relPath,bool writeImageMap=TRUE,
diff --git a/src/dotclassgraph.cpp b/src/dotclassgraph.cpp
index 3f5d228..da272b4 100644
--- a/src/dotclassgraph.cpp
+++ b/src/dotclassgraph.cpp
@@ -420,13 +420,18 @@ bool DotClassGraph::isTrivial() const
bool DotClassGraph::isTooBig() const
{
+ return numNodes()>=DOT_GRAPH_MAX_NODES;
+}
+
+int DotClassGraph::numNodes() const
+{
int numNodes = 0;
numNodes+= m_startNode->children() ? m_startNode->children()->count() : 0;
if (m_graphType==Inheritance)
{
numNodes+= m_startNode->parents() ? m_startNode->parents()->count() : 0;
}
- return numNodes>=DOT_GRAPH_MAX_NODES;
+ return numNodes;
}
DotClassGraph::~DotClassGraph()
diff --git a/src/dotclassgraph.h b/src/dotclassgraph.h
index b3b9291..1874f54 100644
--- a/src/dotclassgraph.h
+++ b/src/dotclassgraph.h
@@ -28,6 +28,7 @@ public:
~DotClassGraph();
bool isTrivial() const;
bool isTooBig() const;
+ int numNodes() const;
QCString writeGraph(FTextStream &t,GraphOutputFormat gf,EmbeddedOutputFormat ef,
const char *path, const char *fileName, const char *relPath,
bool TBRank=TRUE,bool imageMap=TRUE,int graphId=-1);
diff --git a/src/dotincldepgraph.cpp b/src/dotincldepgraph.cpp
index 23588db..05a96d9 100644
--- a/src/dotincldepgraph.cpp
+++ b/src/dotincldepgraph.cpp
@@ -213,8 +213,12 @@ bool DotInclDepGraph::isTrivial() const
bool DotInclDepGraph::isTooBig() const
{
- int numNodes = m_startNode->children() ? m_startNode->children()->count() : 0;
- return numNodes>=Config_getInt(DOT_GRAPH_MAX_NODES);
+ return numNodes()>=Config_getInt(DOT_GRAPH_MAX_NODES);
+}
+
+int DotInclDepGraph::numNodes() const
+{
+ return m_startNode->children() ? m_startNode->children()->count() : 0;
}
void DotInclDepGraph::writeXML(FTextStream &t)
diff --git a/src/dotincldepgraph.h b/src/dotincldepgraph.h
index b664ccb..5807ce8 100644
--- a/src/dotincldepgraph.h
+++ b/src/dotincldepgraph.h
@@ -32,6 +32,7 @@ class DotInclDepGraph : public DotGraph
bool writeImageMap=TRUE,int graphId=-1);
bool isTrivial() const;
bool isTooBig() const;
+ int numNodes() const;
void writeXML(FTextStream &t);
void writeDocbook(FTextStream &t);
diff --git a/src/filedef.cpp b/src/filedef.cpp
index f00c82b..346fb62 100644
--- a/src/filedef.cpp
+++ b/src/filedef.cpp
@@ -664,7 +664,8 @@ void FileDefImpl::writeIncludeGraph(OutputList &ol)
DotInclDepGraph incDepGraph(this,FALSE);
if (incDepGraph.isTooBig())
{
- warn_uncond("Include graph for '%s' not generated, too many nodes. Consider increasing DOT_GRAPH_MAX_NODES.\n",name().data());
+ warn_uncond("Include graph for '%s' not generated, too many nodes (%d), threshold is %d. Consider increasing DOT_GRAPH_MAX_NODES.\n",
+ name().data(), incDepGraph.numNodes(), Config_getInt(DOT_GRAPH_MAX_NODES));
}
else if (!incDepGraph.isTrivial())
{
@@ -688,7 +689,8 @@ void FileDefImpl::writeIncludedByGraph(OutputList &ol)
DotInclDepGraph incDepGraph(this,TRUE);
if (incDepGraph.isTooBig())
{
- warn_uncond("Included by graph for '%s' not generated, too many nodes. Consider increasing DOT_GRAPH_MAX_NODES.\n",name().data());
+ warn_uncond("Included by graph for '%s' not generated, too many nodes (%d), threshold is %d. Consider increasing DOT_GRAPH_MAX_NODES.\n",
+ name().data(), incDepGraph.numNodes(), Config_getInt(DOT_GRAPH_MAX_NODES));
}
else if (!incDepGraph.isTrivial())
{
diff --git a/src/memberdef.cpp b/src/memberdef.cpp
index 9b6967b..840dd78 100644
--- a/src/memberdef.cpp
+++ b/src/memberdef.cpp
@@ -2877,7 +2877,8 @@ void MemberDefImpl::_writeCallGraph(OutputList &ol) const
DotCallGraph callGraph(this,FALSE);
if (callGraph.isTooBig())
{
- warn_uncond("Call graph for '%s' not generated, too many nodes. Consider increasing DOT_GRAPH_MAX_NODES.\n",qPrint(qualifiedName()));
+ warn_uncond("Call graph for '%s' not generated, too many nodes (%d), threshold is %d. Consider increasing DOT_GRAPH_MAX_NODES.\n",
+ qPrint(qualifiedName()), callGraph.numNodes(), Config_getInt(DOT_GRAPH_MAX_NODES));
}
else if (!callGraph.isTrivial())
{
@@ -2900,7 +2901,8 @@ void MemberDefImpl::_writeCallerGraph(OutputList &ol) const
DotCallGraph callerGraph(this, TRUE);
if (callerGraph.isTooBig())
{
- warn_uncond("Caller graph for '%s' not generated, too many nodes. Consider increasing DOT_GRAPH_MAX_NODES.\n",qPrint(qualifiedName()));
+ warn_uncond("Caller graph for '%s' not generated, too many nodes (%d), threshold is %d. Consider increasing DOT_GRAPH_MAX_NODES.\n",
+ qPrint(qualifiedName()), callerGraph.numNodes(), Config_getInt(DOT_GRAPH_MAX_NODES));
}
else if (!callerGraph.isTrivial())
{