Showing 8 of 10 total issues
File page_scraper.py
has 363 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""@page_scraper Responsavel por definir Scraper e seus metodos.""" import osimport jsonimport csv
Function get_reactions
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
def get_reactions(self, page=None, since_date=None, until_date=None): """Raspa informaƧƵes da pƔgina referentes a reaƧƵes.""" if page is None: page = self.page if not self.valid_page(page):
- Read upRead up
Cyclomatic complexity is too high in method get_reactions. (15) Open
def get_reactions(self, page=None, since_date=None, until_date=None): """Raspa informaƧƵes da pƔgina referentes a reaƧƵes.""" if page is None: page = self.page if not self.valid_page(page):
- Read upRead up
- Exclude checks
Cyclomatic complexity is too high in method write_to_csv. (11) Open
def write_to_csv(self, file_name='scraped'): """Grava informaƧƵes da pƔgina raspada em um arquivo CSV.""" def dict_to_list(): content = []
- Read upRead up
- Exclude checks
Cyclomatic complexity is too high in method scrape_current_page. (6) Open
def scrape_current_page(self, page=None, feed=False, query=''): """Raspa dados de uma pƔgina selecionada.""" if page is not None: self.set_page(page) graph = facebook.GraphAPI(access_token=self.token, version="2.12")
- Read upRead up
- Exclude checks
Function write_to_csv
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def write_to_csv(self, file_name='scraped'): """Grava informaƧƵes da pƔgina raspada em um arquivo CSV.""" def dict_to_list(): content = []
- Read upRead up
Similar blocks of code found in 2 locations. Consider refactoring. Wontfix
with open( 'json/' + strftime("%Y-%m-%d") + '/' + file + '.json', 'r', encoding='utf8'
- Read upRead up
Similar blocks of code found in 2 locations. Consider refactoring. Wontfix
with open( 'json/' + strftime("%Y-%m-%d") + '/' + file + '.json', 'w', encoding='utf8'
- Read upRead up
Similar blocks of code found in 2 locations. Consider refactoring. Open
num_comments = 0 if 'comments' not in status else \ status['comments']['summary']['total_count']
- Read upRead up
Similar blocks of code found in 2 locations. Consider refactoring. Open
num_reactions = 0 if 'reactions' not in status else \ status['reactions']['summary']['total_count']
- Read upRead up