Showing 20 of 51 total issues
File hive_hooks.py
has 664 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Function test_hql
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def test_hql(self, hql):
"""
Test an hql statement using the hive cli and EXPLAIN
"""
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function _prepare_cli_cmd
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def _prepare_cli_cmd(self):
"""
This function creates the command list from available information
"""
conn = self.conn
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function run_cli
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def run_cli(self, hql, schema=None, verbose=True, hive_conf=None):
"""
Run an hql statement using the hive cli. If hive_conf is specified
it should be a dict and the entries will be set as key/value pairs
in HiveConf
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function __init__
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function load_df
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def load_df(
Function __init__
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function load_file
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def load_file(
self,
filepath,
table,
delimiter=",",
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method gsob
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static TableSchema gsob() throws IOException {
List<TableFieldSchema> fields = new ArrayList<>();
fields.add(new TableFieldSchema().setName("partition_date").setType("DATE").setMode("NULLABLE"));
fields.add(new TableFieldSchema().setName("temperature_mean").setType("FLOAT").setMode("NULLABLE"));
fields.add(new TableFieldSchema().setName("temperature_min").setType("FLOAT").setMode("NULLABLE"));
Function load_file
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def load_file(
Function to_csv
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def to_csv(
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Avoid deeply nested control flow statements. Open
if not rows:
break
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self,
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self,
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function transfer_data_file
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def transfer_data_file(self, filepath, verbose=True):
filename = os.path.basename(filepath)
destination_path = '/user/cloudera/{0}'.format(filename)
hdfs_cmd = ['hdfs','dfs','-put',filepath,destination_path]
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function get_results
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_results(self, hql, schema='default', arraysize=1000):
from impala.error import ProgrammingError
with self.get_conn(schema) as conn:
if isinstance(hql, basestring):
hql = [hql]
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function get_metastore_client
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_metastore_client(self):
"""
Returns a Hive thrift client.
"""
from thrift.transport import TSocket, TTransport
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"