AlexMathew/scrapple

View on GitHub

Showing 673 of 673 total issues

Block comment should start with '# '
Open

#latex_appendices = []
Severity: Minor
Found in docs/conf.py by pep8

Separate inline comments by at least two spaces.

An inline comment is a comment on the same line as a statement.
Inline comments should be separated by at least two spaces from the
statement. They should start with a # and a single space.

Each line of a block comment starts with a # and a single space
(unless it is indented text inside the comment).

Okay: x = x + 1  # Increment x
Okay: x = x + 1    # Increment x
Okay: # Block comment
E261: x = x + 1 # Increment x
E262: x = x + 1  #Increment x
E262: x = x + 1  #  Increment x
E265: #Block comment
E266: ### Block comment

Block comment should start with '# '
Open

#epub_basename = u'Scrapple'
Severity: Minor
Found in docs/conf.py by pep8

Separate inline comments by at least two spaces.

An inline comment is a comment on the same line as a statement.
Inline comments should be separated by at least two spaces from the
statement. They should start with a # and a single space.

Each line of a block comment starts with a # and a single space
(unless it is indented text inside the comment).

Okay: x = x + 1  # Increment x
Okay: x = x + 1    # Increment x
Okay: # Block comment
E261: x = x + 1 # Increment x
E262: x = x + 1  #Increment x
E262: x = x + 1  #  Increment x
E265: #Block comment
E266: ### Block comment

Block comment should start with '# '
Open

#epub_max_image_width = 0
Severity: Minor
Found in docs/conf.py by pep8

Separate inline comments by at least two spaces.

An inline comment is a comment on the same line as a statement.
Inline comments should be separated by at least two spaces from the
statement. They should start with a # and a single space.

Each line of a block comment starts with a # and a single space
(unless it is indented text inside the comment).

Okay: x = x + 1  # Increment x
Okay: x = x + 1    # Increment x
Okay: # Block comment
E261: x = x + 1 # Increment x
E262: x = x + 1  #Increment x
E262: x = x + 1  #  Increment x
E265: #Block comment
E266: ### Block comment

Refactor this function to reduce its Cognitive Complexity from 44 to the 15 allowed.
Open

    def run(self):
Severity: Critical
Found in scrapple/commands/run.py by sonar-python

Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

See

Refactor this function to reduce its Cognitive Complexity from 25 to the 15 allowed.
Open

    def extract_columns(self, result={}, selector='', table_headers=[], attr='', connector='', default='', verbosity=0, *args, **kwargs):
Severity: Critical
Found in scrapple/selectors/selector.py by sonar-python

Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

See

Refactor this function to reduce its Cognitive Complexity from 16 to the 15 allowed.
Open

    def extract_rows(self, result={}, selector='', table_headers=[], attr='', connector='', default='', verbosity=0, *args, **kwargs):
Severity: Critical
Found in scrapple/selectors/selector.py by sonar-python

Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

See

Refactor this function to reduce its Cognitive Complexity from 31 to the 15 allowed.
Open

def traverse_next(page, nextx, results, tabular_data_headers=[], verbosity=0):
Severity: Critical
Found in scrapple/utils/config.py by sonar-python

Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

See

Merge this if statement with the enclosing one.
Open

        if args['--output_type'] not in ['json', 'csv']:
Severity: Major
Found in scrapple/utils/exceptions.py by sonar-python

Merging collapsible if statements increases the code's readability.

Noncompliant Code Example

if condition1:
    if condition2:
        # ...

Compliant Solution

if condition1 and condition2:
    # ...

Rename function "runCLI" to match the regular expression ^[a-z_][a-z0-9_]{2,}$.
Open

def runCLI():
Severity: Major
Found in scrapple/cmd.py by sonar-python

Shared coding conventions allow teams to collaborate efficiently. This rule checks that all function names match a provided regular expression.

Noncompliant Code Example

With the default provided regular expression: ^[a-z_][a-z0-9_]{2,30}$

def MyFunction(a,b):
    ...

Compliant Solution

def my_function(a,b):
    ...

Method "extract_columns" has 10 parameters, which is greater than the 7 authorized.
Open

    def extract_columns(self, result={}, selector='', table_headers=[], attr='', connector='', default='', verbosity=0, *args, **kwargs):
Severity: Major
Found in scrapple/selectors/selector.py by sonar-python

A long parameter list can indicate that a new structure should be created to wrap the numerous parameters or that the function is doing too many things.

Noncompliant Code Example

With a maximum number of 4 parameters:

def do_something(param1, param2, param3, param4, param5):
    ...

Compliant Solution

def do_something(param1, param2, param3, param4):
    ...

Merge this if statement with the enclosing one.
Open

        if projectname_re.search(args['<projectname>']) is not None:
Severity: Major
Found in scrapple/utils/exceptions.py by sonar-python

Merging collapsible if statements increases the code's readability.

Noncompliant Code Example

if condition1:
    if condition2:
        # ...

Compliant Solution

if condition1 and condition2:
    # ...

Method "extract_rows" has 10 parameters, which is greater than the 7 authorized.
Open

    def extract_rows(self, result={}, selector='', table_headers=[], attr='', connector='', default='', verbosity=0, *args, **kwargs):
Severity: Major
Found in scrapple/selectors/selector.py by sonar-python

A long parameter list can indicate that a new structure should be created to wrap the numerous parameters or that the function is doing too many things.

Noncompliant Code Example

With a maximum number of 4 parameters:

def do_something(param1, param2, param3, param4, param5):
    ...

Compliant Solution

def do_something(param1, param2, param3, param4):
    ...

Remove this commented out code.
Open

# history = open('HISTORY.rst').read().replace('.. :changelog:', '')
Severity: Major
Found in setup.py by sonar-python

Programmers should not comment out code as it bloats programs and reduces readability.

Unused code should be deleted and can be retrieved from source control history if required.

See

  • MISRA C:2004, 2.4 - Sections of code should not be "commented out".
  • MISRA C++:2008, 2-7-2 - Sections of code shall not be "commented out" using C-style comments.
  • MISRA C++:2008, 2-7-3 - Sections of code should not be "commented out" using C++ comments.
  • MISRA C:2012, Dir. 4.4 - Sections of code should not be "commented out"
Severity
Category
Status
Source
Language