MCPcopy Create free account
hub / github.com/Tablecruncher/tablecruncher / checkDataConsistency

Method checkDataConsistency

src/csvapplication.cpp:2844–2864  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2842
2843
2844void CsvApplication::checkDataConsistency() {
2845 int row_top, row_bottom, col_top, col_bottom;
2846 int winIndex = app.getTopWindow();
2847 windows[winIndex].grid->get_selection(row_top, col_top, row_bottom, col_bottom);
2848 if( row_top < 0 || row_bottom < 0 || row_top >= windows[winIndex].table->getNumberRows() || row_bottom >= windows[winIndex].table->getNumberRows() ) {
2849 myFlChoice("Info", "No column selected!", {"OK"});
2850 return;
2851 }
2852 // Check data consistency of column in col_top
2853 showImWorkingWindow("Checking data consistency ...");
2854 size_t countInconsistentRows = windows[winIndex].table->flagInconsistentData(col_top);
2855 hideImWorkingWindow();
2856 windows[winIndex].grid->redraw();
2857 std::string msg;
2858 if( countInconsistentRows == 0 ) {
2859 msg = "No inconsistent rows were found.";
2860 } else {
2861 msg = std::to_string(countInconsistentRows) + " inconsistent row(s) were found and flagged.";
2862 }
2863 myFlChoice("Info", msg, {"OK"});
2864}
2865
2866
2867

Callers 1

Calls 4

to_stringFunction · 0.85
getTopWindowMethod · 0.80
getNumberRowsMethod · 0.80
flagInconsistentDataMethod · 0.80

Tested by

no test coverage detected