eisen-dev/eisen_engine

View on GitHub

Showing 44 of 44 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

class recipeResultAPI(Resource):
decorators = [auth.login_required]
 
def __init__(self):
self.reqparse = reqparse.RequestParser()
Severity: Major
Found in resources/recipes.py and 1 other location - About 4 days to fix
resources/Tasks.py on lines 172..211

Similar blocks of code found in 2 locations. Consider refactoring.
Open

class TaskResultAPI(Resource):
decorators = [auth.login_required]
 
def __init__(self):
self.reqparse = reqparse.RequestParser()
Severity: Major
Found in resources/Tasks.py and 1 other location - About 4 days to fix
resources/recipes.py on lines 169..208

Similar blocks of code found in 3 locations. Consider refactoring.
Open

class recipeAPI(Resource):
decorators = [auth.login_required]
 
def __init__(self):
self.reqparse = reqparse.RequestParser()
Severity: Major
Found in resources/recipes.py and 2 other locations - About 3 days to fix
resources/GroupsList.py on lines 101..133
resources/Tasks.py on lines 90..122

Similar blocks of code found in 3 locations. Consider refactoring.
Open

class GroupVarsAPI(Resource):
decorators = [auth.login_required]
 
def __init__(self):
self.reqparse = reqparse.RequestParser()
Severity: Major
Found in resources/GroupsList.py and 2 other locations - About 3 days to fix
resources/Tasks.py on lines 90..122
resources/recipes.py on lines 90..122

Similar blocks of code found in 3 locations. Consider refactoring.
Open

class TaskAPI(Resource):
decorators = [auth.login_required]
 
def __init__(self):
self.reqparse = reqparse.RequestParser()
Severity: Major
Found in resources/Tasks.py and 2 other locations - About 3 days to fix
resources/GroupsList.py on lines 101..133
resources/recipes.py on lines 90..122

Similar blocks of code found in 2 locations. Consider refactoring.
Open

class recipesAPI(Resource):
decorators = [auth.login_required]
 
def __init__(self):
self.reqparse = reqparse.RequestParser()
Severity: Major
Found in resources/recipes.py and 1 other location - About 2 days to fix
resources/Tasks.py on lines 45..87

Similar blocks of code found in 2 locations. Consider refactoring.
Open

class TasksAPI(Resource):
decorators = [auth.login_required]
 
def __init__(self):
self.reqparse = reqparse.RequestParser()
Severity: Major
Found in resources/Tasks.py and 1 other location - About 2 days to fix
resources/recipes.py on lines 45..87

Identical blocks of code found in 2 locations. Consider refactoring.
Open

elif target_host_os == 'Gentoo':
package_line = packages['contacted'][target_host_ip]['stdout']
package_list = package_line.split('\n')
for package in package_list:
category_name_version = package.split(' ')
Severity: Major
Found in core/PackageListUpdate.py and 1 other location - About 1 day to fix
core/PackageListUpdate.py on lines 122..170

Identical blocks of code found in 2 locations. Consider refactoring.
Open

elif target_host_os == 'Gentoo':
try:
package_line = packages['contacted'][target_host_ip]['stdout']
except Exception, error:
print error
Severity: Major
Found in core/PackageListUpdate.py and 1 other location - About 1 day to fix
core/PackageListUpdate.py on lines 198..242

Similar blocks of code found in 2 locations. Consider refactoring.
Open

def os_remove_command(pack):
if pack['targetOS'] == 'Raspbian':
pack['targetOS'] = 'Ubuntu'
 
if pack['targetOS'] == 'Ubuntu':
Severity: Major
Found in core/os_dependant.py and 1 other location - About 1 day to fix
core/os_dependant.py on lines 66..80

Similar blocks of code found in 2 locations. Consider refactoring.
Open

def os_update_command(pack):
if pack['targetOS'] == 'Raspbian':
pack['targetOS'] = 'Ubuntu'
if pack['targetOS'] == 'Ubuntu':
print 'loading module apt'
Severity: Major
Found in core/os_dependant.py and 1 other location - About 1 day to fix
core/os_dependant.py on lines 49..64

Function get_installed_package has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
Open

def get_installed_package(target_host_ip, command, target_host_os):
delete_user_machine_packages(target_host_ip)
a= AnsibleV1Inv.get_inv()
packages = RunTask(target_host_ip, command,"shell",a)
if target_host_os == 'Ubuntu':
Severity: Minor
Found in core/PackageListUpdate.py - About 5 hrs to fix

Similar blocks of code found in 2 locations. Consider refactoring.
Open

for package in package_list:
category_name_version = package.split(' ')
package_category = category_name_version[0]
package_name = category_name_version[1]
packge_version = category_name_version[2]
Severity: Major
Found in core/PackageListUpdate.py and 1 other location - About 5 hrs to fix
core/PackageListUpdate.py on lines 201..214

Similar blocks of code found in 2 locations. Consider refactoring.
Open

for package in package_list:
category_name_version = package.split(' ')
package_category = category_name_version[0]
package_name = category_name_version[1]
packge_version = category_name_version[2]
Severity: Major
Found in core/PackageListUpdate.py and 1 other location - About 5 hrs to fix
core/PackageListUpdate.py on lines 130..142

Similar blocks of code found in 3 locations. Consider refactoring.
Open

def post(self):
args = self.reqparse.parse_args()
host = {
'id': packs[-1]['id'] + 1,
'module': args['module'],
Severity: Major
Found in resources/package_retrive.py and 2 other locations - About 4 hrs to fix
resources/AgentInfo.py on lines 56..64
resources/GroupsList.py on lines 57..65

Similar blocks of code found in 3 locations. Consider refactoring.
Open

def post(self):
args = self.reqparse.parse_args()
group = {
'id': groups[-1]['id'] + 1,
'hosts': args['hosts'],
Severity: Major
Found in resources/GroupsList.py and 2 other locations - About 4 hrs to fix
resources/AgentInfo.py on lines 56..64
resources/package_retrive.py on lines 88..96

Similar blocks of code found in 3 locations. Consider refactoring.
Open

def post(self):
args = self.reqparse.parse_args()
host = {
'id': agents[-1]['id'] + 1,
'module': args['module'],
Severity: Major
Found in resources/AgentInfo.py and 2 other locations - About 4 hrs to fix
resources/GroupsList.py on lines 57..65
resources/package_retrive.py on lines 88..96

Similar blocks of code found in 2 locations. Consider refactoring.
Open

def repository_all(os):
print os
if os == 'Ubuntu' or os == 'Raspbian':
command = "apt-cache search ."
elif os == 'Gentoo':
Severity: Major
Found in core/PackageListUpdate.py and 1 other location - About 4 hrs to fix
core/PackageListUpdate.py on lines 60..71

Similar blocks of code found in 2 locations. Consider refactoring.
Open

def repository_installed(os):
print os
if os == 'Ubuntu' or os == 'Raspbian':
command = "dpkg -l | awk 'NR>5{print $0}'"
elif os == 'Gentoo':
Severity: Major
Found in core/PackageListUpdate.py and 1 other location - About 4 hrs to fix
core/PackageListUpdate.py on lines 73..85

Similar blocks of code found in 2 locations. Consider refactoring.
Open

def __init__(self):
self.reqparse = reqparse.RequestParser()
self.reqparse.add_argument('module', type=str, required=True,
help='No task title provided',
location='json')
Severity: Major
Found in resources/AgentInfo.py and 1 other location - About 4 hrs to fix
resources/package_retrive.py on lines 74..82
Severity
Category
Status
Source
Language