Showing 46 of 86 total issues
File bootstrap.py
has 13507 lines of code (exceeds 250 allowed). Consider refactoring. Open
css = u"""/*!
* Bootstrap v3.3.6 (http://getbootstrap.com)
* Copyright 2011-2015 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
File cerulean.py
has 6906 lines of code (exceeds 250 allowed). Consider refactoring. Open
css = u"""
/*!
* bootswatch v3.3.6
* Homepage: http://bootswatch.com
* Copyright 2012-2015 Thomas Park
File journal.py
has 6853 lines of code (exceeds 250 allowed). Consider refactoring. Open
css = u"""
@import url("https://fonts.googleapis.com/css?family=News+Cycle:400,700");
/*!
* bootswatch v3.3.6
* Homepage: http://bootswatch.com
File skeleton.py
has 511 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
# Modified from skeleton from getskeleton.com
# Smaller headers
css = u"""
File readers.py
has 484 lines of code (exceeds 250 allowed). Consider refactoring. Open
# Pweave readers
import re
import copy
import json
import io
Function run_cell
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
def run_cell(self, src):
cell = {}
cell["source"] = src.lstrip()
msg_id = self.kc.execute(src.lstrip(), store_history=False)
- 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 _runcode
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
def _runcode(self, chunk):
"""Execute code from a code chunk based on options"""
if chunk["type"] != "doc" and chunk["type"] != "code":
return chunk
- 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
PwebFormatter
has 33 functions (exceeds 20 allowed). Consider refactoring. Open
class PwebFormatter(object):
"""Base class for all not-notebook formatters"""
def __init__(
self,
Function parse
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
def parse(self):
lines = self.rawtext.splitlines()
read = ""
chunks = []
- 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 parse
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def parse(self):
lines = self.rawtext.splitlines()
read = ""
chunks = []
- 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 format
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def format(self):
self.formatted = []
for chunk in self.executed:
# Fill in options for code chunks
if chunk["type"] == "code":
- 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 format_codechunks
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def format_codechunks(self, chunk):
chunk["content"] = self._indent(chunk["content"])
# Code is not executed
if not chunk["evaluate"]:
- 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
File base.py
has 262 lines of code (exceeds 250 allowed). Consider refactoring. Open
import textwrap
import os
import base64
import copy
from nbconvert import filters
PwebProcessorBase
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
class PwebProcessorBase(object):
"""Processors run code from parsed Pweave documents. This is an abstract base
class for specific implementations"""
def __init__(self, parsed, kernel, source, docmode, figdir, outdir):
Function render_jupyter_output
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def render_jupyter_output(self, out, chunk):
if out["output_type"] == "error":
return self.render_traceback("".join(out["traceback"]), chunk)
if out["output_type"] == "stream":
- 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 weave
has 13 arguments (exceeds 4 allowed). Consider refactoring. Open
def weave(
Function formatfigure
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def formatfigure(self, chunk):
fignames = chunk["figure"]
caption = chunk["caption"]
width = chunk["width"]
label = chunk["name"]
- 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 formatfigure
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def formatfigure(self, chunk):
fignames = chunk["figure"]
caption = chunk["caption"]
width = chunk["width"]
result = ""
- 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 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function __init__
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(