martinheidegger/block-cache

View on GitHub

Showing 17 of 20 total issues

Function constructor has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

  constructor (internal, path, opts) {
    let isClosed = false
    let closeCb
    let reading = 0
    const init = mem.props({
Severity: Minor
Found in CachedFile.js - About 2 hrs to fix

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 _read has 44 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  _read (buffer, offset, length, start, cb) {
    if (start === undefined || start === null) {
      start = this.position
    }
    const end = (length === undefined || length === null) ? null : start + length
Severity: Minor
Found in CachedFile.js - About 1 hr to fix

    Function constructor has 40 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      constructor (internal, path, opts) {
        let isClosed = false
        let closeCb
        let reading = 0
        const init = mem.props({
    Severity: Minor
    Found in CachedFile.js - About 1 hr to fix

      Function constructor has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        constructor (fs, cacheOpts) {
          if (!fs) throw err('ERR_INVALID_ARG_TYPE', 'fs option required, this package doesnt assume which fs you want to use, see: hyperdrive')
      
          cacheOpts = Object.assign({
            cacheSize: DEFAULT_CACHE_SIZE,
      Severity: Minor
      Found in Cache.js - About 1 hr to fix

        Line length
        Open

        # [2.0.0](https://github.com/martinheidegger/block-cache/compare/v1.0.0...v2.0.0) (2018-03-06)
        Severity: Info
        Found in CHANGELOG.md by markdownlint

        MD013 - Line length

        Tags: line_length

        Aliases: line-length Parameters: linelength, codeblocks, tables (number; default 80, boolean; default true)

        This rule is triggered when there are lines that are longer than the configured line length (default: 80 characters). To fix this, split the line up into multiple lines.

        This rule has an exception where there is no whitespace beyond the configured line length. This allows you to still include items such as long URLs without being forced to break them in the middle.

        You also have the option to exclude this rule for code blocks and tables. To do this, set the code_blocks and/or tables parameters to false.

        Code blocks are included in this rule by default since it is often a requirement for document readability, and tentatively compatible with code rules. Still, some languages do not lend themselves to short lines.

        Multiple consecutive blank lines
        Open

        
        
        Severity: Info
        Found in CHANGELOG.md by markdownlint

        MD012 - Multiple consecutive blank lines

        Tags: whitespace, blank_lines

        Aliases: no-multiple-blanks

        This rule is triggered when there are multiple consecutive blank lines in the document:

        Some text here
        
        
        Some more text here

        To fix this, delete the offending lines:

        Some text here
        
        Some more text here

        Note: this rule will not be triggered if there are multiple consecutive blank lines inside code blocks.

        Line length
        Open

        * **freeze:** file pointers created through Cache.open and Cache.openSync are frozen now. ([e5a00ce](https://github.com/martinheidegger/block-cache/commit/e5a00ce))
        Severity: Info
        Found in CHANGELOG.md by markdownlint

        MD013 - Line length

        Tags: line_length

        Aliases: line-length Parameters: linelength, codeblocks, tables (number; default 80, boolean; default true)

        This rule is triggered when there are lines that are longer than the configured line length (default: 80 characters). To fix this, split the line up into multiple lines.

        This rule has an exception where there is no whitespace beyond the configured line length. This allows you to still include items such as long URLs without being forced to break them in the middle.

        You also have the option to exclude this rule for code blocks and tables. To do this, set the code_blocks and/or tables parameters to false.

        Code blocks are included in this rule by default since it is often a requirement for document readability, and tentatively compatible with code rules. Still, some languages do not lend themselves to short lines.

        Line length
        Open

        * **sandbox:** The documented method `Cached.fd` and `Cached.prefix` were giving informations about the implementation details and they have been removed.
        Severity: Info
        Found in CHANGELOG.md by markdownlint

        MD013 - Line length

        Tags: line_length

        Aliases: line-length Parameters: linelength, codeblocks, tables (number; default 80, boolean; default true)

        This rule is triggered when there are lines that are longer than the configured line length (default: 80 characters). To fix this, split the line up into multiple lines.

        This rule has an exception where there is no whitespace beyond the configured line length. This allows you to still include items such as long URLs without being forced to break them in the middle.

        You also have the option to exclude this rule for code blocks and tables. To do this, set the code_blocks and/or tables parameters to false.

        Code blocks are included in this rule by default since it is often a requirement for document readability, and tentatively compatible with code rules. Still, some languages do not lend themselves to short lines.

        Trailing spaces
        Open

        file pointer references on the underlying file system.  
        Severity: Info
        Found in Readme.md by markdownlint

        MD009 - Trailing spaces

        Tags: whitespace

        Aliases: no-trailing-spaces

        Parameters: br_spaces (number; default: 0)

        This rule is triggered on any lines that end with whitespace. To fix this, find the line that is triggered and remove any trailing spaces from the end.

        The brspaces parameter allows an exception to this rule for a specific amount of trailing spaces used to insert an explicit line break/br element. For example, set brspaces to 2 to allow exactly 2 spaces at the end of a line.

        Note: you have to set brspaces to 2 or higher for this exception to take effect - you can't insert a br element with just a single trailing space, so if you set brspaces to 1, the exception will be disabled, just as if it was set to the default of 0.

        Multiple consecutive blank lines
        Open

        
        
        Severity: Info
        Found in CHANGELOG.md by markdownlint

        MD012 - Multiple consecutive blank lines

        Tags: whitespace, blank_lines

        Aliases: no-multiple-blanks

        This rule is triggered when there are multiple consecutive blank lines in the document:

        Some text here
        
        
        Some more text here

        To fix this, delete the offending lines:

        Some text here
        
        Some more text here

        Note: this rule will not be triggered if there are multiple consecutive blank lines inside code blocks.

        Line length
        Open

        All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
        Severity: Info
        Found in CHANGELOG.md by markdownlint

        MD013 - Line length

        Tags: line_length

        Aliases: line-length Parameters: linelength, codeblocks, tables (number; default 80, boolean; default true)

        This rule is triggered when there are lines that are longer than the configured line length (default: 80 characters). To fix this, split the line up into multiple lines.

        This rule has an exception where there is no whitespace beyond the configured line length. This allows you to still include items such as long URLs without being forced to break them in the middle.

        You also have the option to exclude this rule for code blocks and tables. To do this, set the code_blocks and/or tables parameters to false.

        Code blocks are included in this rule by default since it is often a requirement for document readability, and tentatively compatible with code rules. Still, some languages do not lend themselves to short lines.

        Header levels should only increment by one level at a time
        Open

        ### Features
        Severity: Info
        Found in CHANGELOG.md by markdownlint

        MD001 - Header levels should only increment by one level at a time

        Tags: headers

        Aliases: header-increment

        This rule is triggered when you skip header levels in a markdown document, for example:

        # Header 1
        
        ### Header 3
        
        We skipped out a 2nd level header in this document

        When using multiple header levels, nested headers should increase by only one level at a time:

        # Header 1
        
        ## Header 2
        
        ### Header 3
        
        #### Header 4
        
        ## Another Header 2
        
        ### Another Header 3

        Line length
        Open

        * **freeze:** Using defineProperties for CachedFile properties to make sure that the instances are freezable. ([f3222c1](https://github.com/martinheidegger/block-cache/commit/f3222c1))
        Severity: Info
        Found in CHANGELOG.md by markdownlint

        MD013 - Line length

        Tags: line_length

        Aliases: line-length Parameters: linelength, codeblocks, tables (number; default 80, boolean; default true)

        This rule is triggered when there are lines that are longer than the configured line length (default: 80 characters). To fix this, split the line up into multiple lines.

        This rule has an exception where there is no whitespace beyond the configured line length. This allows you to still include items such as long URLs without being forced to break them in the middle.

        You also have the option to exclude this rule for code blocks and tables. To do this, set the code_blocks and/or tables parameters to false.

        Code blocks are included in this rule by default since it is often a requirement for document readability, and tentatively compatible with code rules. Still, some languages do not lend themselves to short lines.

        Multiple consecutive blank lines
        Open

        
        
        Severity: Info
        Found in CHANGELOG.md by markdownlint

        MD012 - Multiple consecutive blank lines

        Tags: whitespace, blank_lines

        Aliases: no-multiple-blanks

        This rule is triggered when there are multiple consecutive blank lines in the document:

        Some text here
        
        
        Some more text here

        To fix this, delete the offending lines:

        Some text here
        
        Some more text here

        Note: this rule will not be triggered if there are multiple consecutive blank lines inside code blocks.

        Line length
        Open

        * **sandbox:** Sandboxing the Cache to make sure users of Cache can not access/modify the filesystem. ([ac90063](https://github.com/martinheidegger/block-cache/commit/ac90063))
        Severity: Info
        Found in CHANGELOG.md by markdownlint

        MD013 - Line length

        Tags: line_length

        Aliases: line-length Parameters: linelength, codeblocks, tables (number; default 80, boolean; default true)

        This rule is triggered when there are lines that are longer than the configured line length (default: 80 characters). To fix this, split the line up into multiple lines.

        This rule has an exception where there is no whitespace beyond the configured line length. This allows you to still include items such as long URLs without being forced to break them in the middle.

        You also have the option to exclude this rule for code blocks and tables. To do this, set the code_blocks and/or tables parameters to false.

        Code blocks are included in this rule by default since it is often a requirement for document readability, and tentatively compatible with code rules. Still, some languages do not lend themselves to short lines.

        Multiple consecutive blank lines
        Open

        
        
        Severity: Info
        Found in CHANGELOG.md by markdownlint

        MD012 - Multiple consecutive blank lines

        Tags: whitespace, blank_lines

        Aliases: no-multiple-blanks

        This rule is triggered when there are multiple consecutive blank lines in the document:

        Some text here
        
        
        Some more text here

        To fix this, delete the offending lines:

        Some text here
        
        Some more text here

        Note: this rule will not be triggered if there are multiple consecutive blank lines inside code blocks.

        Line length
        Open

        * **api:** Added disconnect api that allows the disconnection of a Cache instance from its `fs` ([f87135e](https://github.com/martinheidegger/block-cache/commit/f87135e))
        Severity: Info
        Found in CHANGELOG.md by markdownlint

        MD013 - Line length

        Tags: line_length

        Aliases: line-length Parameters: linelength, codeblocks, tables (number; default 80, boolean; default true)

        This rule is triggered when there are lines that are longer than the configured line length (default: 80 characters). To fix this, split the line up into multiple lines.

        This rule has an exception where there is no whitespace beyond the configured line length. This allows you to still include items such as long URLs without being forced to break them in the middle.

        You also have the option to exclude this rule for code blocks and tables. To do this, set the code_blocks and/or tables parameters to false.

        Code blocks are included in this rule by default since it is often a requirement for document readability, and tentatively compatible with code rules. Still, some languages do not lend themselves to short lines.

        Severity
        Category
        Status
        Source
        Language