Showing 29 of 143 total issues
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(commit, path, file_name, part, position)
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(book, commit, path, element, position)
Function Root
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const Root: React.FC = () => {
const renderUserInfo = () => {
return (
<CurrentUserContext.Consumer>
{(user: CurrentUserType) =>
- 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 Header
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const Header: React.FC<HeaderProps> = ({ permalink, noteNumber }) => {
const renderSuffix = (book: Book, noteNumber?: number) => {
const bookRoot = `/books/${book.permalink}`;
if (noteNumber) {
return (
- 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 Element
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const Element: React.FC<ElementProps> = (props) => {
const { noteCount: initialNoteCount, id, bookPermalink } = props;
const [noteCount, setNoteCount] = useState<number>(initialNoteCount);
const [showNotes, setShowNotes] = useState<boolean>(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
Method call
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def call(token)
return Failure("no token specified") if !token || token.length == 0
token = token.split.last
return Failure("no token specified") unless token
- 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 process_manifest
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def process_manifest
lines = File.readlines(Pathname.new(path) + "manuscript/Book.txt")
parts = Hash.new { |h, k| h[k] = [] }
part = :mainmatter
lines.each do |line|
- 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 process_div
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def process_div(element)
return unless element["class"]
classes = element["class"].split(" ")
- 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 InviteForm
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const InviteForm: React.FC<InviteFormProps> = ({
bookPermalink,
bookTitle,
bookId,
bookReaders,
- 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"