Fix coding rule violations 52/87752/2
authorSomin Kim <somin926.kim@samsung.com>
Fri, 9 Sep 2016 08:44:00 +0000 (17:44 +0900)
committerSomin Kim <somin926.kim@samsung.com>
Fri, 9 Sep 2016 10:20:43 +0000 (19:20 +0900)
Change-Id: Ifed0d9c3accdb5f1de3957591fa86ce9d85708e7
Signed-off-by: Somin Kim <somin926.kim@samsung.com>
src/app-stats/app_inactive_detector/InactiveDetectorStorage.cpp
src/prediction/assoc_rule_miner.cpp
src/prediction/assoc_rule_producer.h
src/prediction/basket_compressor.cpp
src/prediction/item_catalogue.cpp
src/prediction/item_catalogue.h
src/prediction/weight_apriori.cpp
src/prediction/weight_apriori.h
src/social-stats/LogAggregator.cpp

index 7fd11a73fdf12611c418b0e7378abd0f6dda08b2..83499475d7c4abdee0637e2ba5a58f186bf65eca 100644 (file)
@@ -178,7 +178,7 @@ void ctx::InactiveDetectorStorage::__injectParams(std::string& str, const std::s
                return;
 
        size_t startPos = 0;
-       while((startPos = str.find(from, startPos)) != std::string::npos) {
+       while ((startPos = str.find(from, startPos)) != std::string::npos) {
                str.replace(startPos, from.length(), to);
                startPos += to.length();
        }
index a639af8afe400fe68ce59e0e120a5eee2a195c3e..38affdeb226283dbdfbae45abbc67c9f055e7e60 100644 (file)
@@ -30,7 +30,7 @@ std::list<ctx::AssocRule> ctx::AssocRuleMiner::mine_from_baskets(
                std::string consequentCategory)
 {
        SingleCategoryItemIdFilter itemIdFilter(consequentCategory, itemCatalogue);
-       BasketFilter::filter_in_place(initBaskets,itemIdFilter);
+       BasketFilter::filter_in_place(initBaskets, itemIdFilter);
 
        std::list<Basket> compressedBaskets = BasketCompressor::compress(initBaskets);
 
index 2b02b792fd9a43b868853a9c2143abc9ee84daa8..17c5d3af374d25a8b3e54515408664df6ea9d916 100644 (file)
@@ -28,14 +28,14 @@ namespace ctx {
 
        public:
                static std::list<AssocRuleOfIds> generate_rules(
-                               const std::list<std::pair<ItemIdSet,double>> &freqItemIdSets,
+                               const std::list<std::pair<ItemIdSet, double>> &freqItemIdSets,
                                const IItemIdFilter &itemIdFilter,
                                double minConfidence);
 
                static AssocRuleOfIds rule_template(const ItemIdSet &sourceItemIdSet, const IItemIdFilter &antecedentItemIdFilter);
 
        private:
-               static double supportOf(const std::list<std::pair<ItemIdSet,double>> &allFreqItemIdSets, const ItemIdSet &wanted);
+               static double supportOf(const std::list<std::pair<ItemIdSet, double>> &allFreqItemIdSets, const ItemIdSet &wanted);
 
        };
 
index f46c40de7782cc30d63168edc443246cd24717c4..31086bde3c112496a7cdde60eb447db424218ad4 100644 (file)
@@ -29,7 +29,7 @@ std::string ctx::BasketCompressor::itemset_string(const ctx::ItemIdSet& itemIdSe
 
 std::list<ctx::Basket> ctx::BasketCompressor::compress(const std::list<ctx::Basket>& inputBaskets)
 {
-       std::map<std::string,Basket> basketsMap;
+       std::map<std::string, Basket> basketsMap;
        // TODO: maybe it is worth to resign from string keys and use std::map<ItemSet,weight> instead.
 
        for (const Basket& basket : inputBaskets) {
@@ -37,7 +37,7 @@ std::list<ctx::Basket> ctx::BasketCompressor::compress(const std::list<ctx::Bask
 
                auto findResult = basketsMap.find(itemSetStr);
                if (findResult == basketsMap.end()) {
-                       basketsMap.insert(std::pair<std::string,Basket>(itemSetStr, basket));
+                       basketsMap.insert(std::pair<std::string, Basket>(itemSetStr, basket));
                } else {
                        Basket& compressedBasket = findResult->second;
                        compressedBasket.weight += basket.weight;
index 666b5a8b171b891acc046a96df6aaedf2747a11f..57189c4fbda85c2e4dfe40d4f49a557c5f4c6e26 100644 (file)
@@ -20,7 +20,7 @@
 int ctx::ItemCatalogue::id_of(const ctx::Item& item)
 {
        std::string s = ItemStringConverter::item_to_string(item);
-       std::map<std::string,int>::iterator it = mItemIdsOfStrings.find(s);
+       std::map<std::string, int>::iterator it = mItemIdsOfStrings.find(s);
        if (it == mItemIdsOfStrings.end()) { // new item
                mMaxId++;
                mItemIdsOfStrings[s] = mMaxId;
index 404765b252c2a66236e115e6110b8be71d016283..92f727dac96966e6096abcaba65ed72595746b87 100644 (file)
@@ -40,10 +40,10 @@ namespace ctx {
 
        private:
                /* Translates item string to its id */
-               std::map<std::string,int> mItemIdsOfStrings;
+               std::map<std::string, int> mItemIdsOfStrings;
 
                /* Translating category string to int */
-               std::map<std::string,std::set<int>> mCategoryItemIds;
+               std::map<std::string, std::set<int>> mCategoryItemIds;
 
                /* Stores item strings (index is item's id) */
                std::vector<std::string> mItemStrings;
index 92aaebc3e38de9f7dc329bad6d8df51118b440f7..c95fe0db8d2e64f0cb3a2068430c81e6d158652a 100644 (file)
@@ -82,7 +82,7 @@ std::list<std::pair<ctx::ItemIdSet, double>> ctx::WeightApriori::find_frequent_i
                        double support = basketAgregator.supportOf(candidate);
                        if (support >= supportThreshold) {
                                freqItemsetsOfCurrSize.push_back(candidate);
-                               allFreqItemsets.push_back(std::make_pair(candidate,support));
+                               allFreqItemsets.push_back(std::make_pair(candidate, support));
                        }
                }
                candidates = find_wider_candidates(freqItemsetsOfCurrSize, ++candidateSize);
index 6cb493dc425bece56cc54eccfe012a57e8525c58..2749023ebdf513270d51d585d6ebf70a850aed61 100644 (file)
@@ -32,7 +32,7 @@ namespace ctx {
                static bool survives_prunning(ItemIdSet &widerCandidate, const std::list<ItemIdSet> &narrowFreqSets);
 
                /* Find frequent itemsets along with its support value. */
-               static std::list<std::pair<ItemIdSet,double>> find_frequent_itemid_sets(BasketsAgregator &basketAgregator, double supportThreshold);
+               static std::list<std::pair<ItemIdSet, double>> find_frequent_itemid_sets(BasketsAgregator &basketAgregator, double supportThreshold);
 
        private:
                static std::list<ItemIdSet> single_size_candidates(BasketsAgregator &basketAgregator);
index 63dbfea561807e9d8b303daa0924cd82c5371b0d..fc7576f76a0f23dc80cc1ae2e0a28e57a3a823c1 100644 (file)
@@ -154,7 +154,7 @@ void ctx::ContactLogAggregator::__insertContactLogList(contacts_list_h list)
 
                __dbManager.insert(0, SOCIAL_TABLE_CONTACT_LOG, data, NULL);
 
-       } while(contacts_list_next(list) == CONTACTS_ERROR_NONE);
+       } while (contacts_list_next(list) == CONTACTS_ERROR_NONE);
 }
 
 void ctx::ContactLogAggregator::__removeExpiredLog()