jameswlane/jest-express

View on GitHub

Showing 222 of 222 total issues

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

  constructor() {
    // Properties
    this.headers = {};
    this.headersSent = false;
    this.locals = {};
Severity: Major
Found in src/response.ts - About 2 hrs to fix

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

      constructor() {
        this.request = new Request(null, { app: this });
        this.response = new Response();
        this.next = next;
        // Properties
    Severity: Major
    Found in src/express.ts - About 2 hrs to fix

      Request has 23 functions (exceeds 20 allowed). Consider refactoring.
      Open

      export class Request {
        // Properties
        public baseUrl: string;
        public body: any;
        public cookies: any;
      Severity: Minor
      Found in src/request.ts - About 2 hrs to fix

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

          constructor() {
            const handler = (path: any, ...callbacks: any): void => {
              const flattened = [].concat(...callbacks); // flatten array
              if (typeof path === 'string' && flattened.every((cb: any) => typeof cb === 'function')) {
                flattened.forEach((cb: any) => cb(this.request, this.response, this.next));
        Severity: Minor
        Found in src/router.ts - About 1 hr to fix

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

            constructor() {
              this.request = new Request(null, { app: this });
              this.response = new Response();
              this.next = next;
              // Properties
          Severity: Minor
          Found in src/express.ts - About 1 hr 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 constructor has 36 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            constructor(url?: string | null, options?: IRequestOptions) {
              // Properties
              this.baseUrl = '';
              this.body = '';
              this.cookies = {};
          Severity: Minor
          Found in src/request.ts - About 1 hr to fix

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

              constructor() {
                // Properties
                this.headers = {};
                this.headersSent = false;
                this.locals = {};
            Severity: Minor
            Found in src/response.ts - About 1 hr 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 setUrl has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

              public setUrl(url: string, options?: IRequestOptions) {
                const parsedUrl = parse(url, true);
            
                this.path = parsedUrl.pathname || '/';
                this.hostname = parsedUrl.hostname || '';
            Severity: Minor
            Found in src/request.ts - About 1 hr 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 resetMocked has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              public resetMocked() {
                // Properties
                this.baseUrl = '';
                this.body = '';
                this.cookies = {};
            Severity: Minor
            Found in src/request.ts - About 1 hr to fix

              Function resetMocked has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                public resetMocked() {
                  // Properties
                  this.locals = {};
                  this.error = {};
                  this.mountpath = '';
              Severity: Minor
              Found in src/express.ts - About 1 hr to fix

                Function resetMocked has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  public resetMocked() {
                    // Properties
                    this.headers = {};
                    this.headersSent = false;
                    this.locals = {};
                Severity: Minor
                Found in src/response.ts - About 1 hr to fix

                  Function setUrl has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    public setUrl(url: string, options?: IRequestOptions) {
                      const parsedUrl = parse(url, true);
                  
                      this.path = parsedUrl.pathname || '/';
                      this.hostname = parsedUrl.hostname || '';
                  Severity: Minor
                  Found in src/request.ts - About 1 hr to fix

                    Line length
                    Open

                    In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
                    Severity: Info
                    Found in CODE_OF_CONDUCT.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 ISSUE_TEMPLATE.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

                        <td align="center"><a href="http://hrkeni.me"><img src="https://avatars1.githubusercontent.com/u/1170292?v=4" width="100px;" alt=""/><br /><sub><b>Harshith Keni</b></sub></a><br /><a href="https://github.com/jameswlane/jest-express/commits?author=hrkeni" title="Code">πŸ’»</a></td>
                    Severity: Info
                    Found in README.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.

                    Inline HTML
                    Open

                        <td align="center"><a href="http://fueledbydreams.com"><img src="https://avatars2.githubusercontent.com/u/794161?v=4" width="100px;" alt=""/><br /><sub><b>James W. Lane III</b></sub></a><br /><a href="https://github.com/jameswlane/jest-express/commits?author=jameswlane" title="Code">πŸ’»</a> <a href="https://github.com/jameswlane/jest-express/commits?author=jameswlane" title="Documentation">πŸ“–</a> <a href="#infra-jameswlane" title="Infrastructure (Hosting, Build-Tools, etc)">πŸš‡</a> <a href="https://github.com/jameswlane/jest-express/commits?author=jameswlane" title="Tests">⚠️</a> <a href="#tool-jameswlane" title="Tools">πŸ”§</a></td>
                    Severity: Info
                    Found in README.md by markdownlint

                    MD033 - Inline HTML

                    Tags: html

                    Aliases: no-inline-html

                    This rule is triggered whenever raw HTML is used in a markdown document:

                    Inline HTML header

                    To fix this, use 'pure' markdown instead of including raw HTML:

                    # Markdown header

                    Rationale: Raw HTML is allowed in markdown, but this rule is included for those who want their documents to only include "pure" markdown, or for those who are rendering markdown documents in something other than HTML.

                    Inline HTML
                    Open

                        <td align="center"><a href="http://fueledbydreams.com"><img src="https://avatars2.githubusercontent.com/u/794161?v=4" width="100px;" alt=""/><br /><sub><b>James W. Lane III</b></sub></a><br /><a href="https://github.com/jameswlane/jest-express/commits?author=jameswlane" title="Code">πŸ’»</a> <a href="https://github.com/jameswlane/jest-express/commits?author=jameswlane" title="Documentation">πŸ“–</a> <a href="#infra-jameswlane" title="Infrastructure (Hosting, Build-Tools, etc)">πŸš‡</a> <a href="https://github.com/jameswlane/jest-express/commits?author=jameswlane" title="Tests">⚠️</a> <a href="#tool-jameswlane" title="Tools">πŸ”§</a></td>
                    Severity: Info
                    Found in README.md by markdownlint

                    MD033 - Inline HTML

                    Tags: html

                    Aliases: no-inline-html

                    This rule is triggered whenever raw HTML is used in a markdown document:

                    Inline HTML header

                    To fix this, use 'pure' markdown instead of including raw HTML:

                    # Markdown header

                    Rationale: Raw HTML is allowed in markdown, but this rule is included for those who want their documents to only include "pure" markdown, or for those who are rendering markdown documents in something other than HTML.

                    Inline HTML
                    Open

                        <td align="center"><a href="http://sheerun.net"><img src="https://avatars0.githubusercontent.com/u/292365?v=4" width="100px;" alt=""/><br /><sub><b>Adam Stankiewicz</b></sub></a><br /><a href="https://github.com/jameswlane/jest-express/issues?q=author%3Asheerun" title="Bug reports">πŸ›</a> <a href="https://github.com/jameswlane/jest-express/commits?author=sheerun" title="Code">πŸ’»</a> <a href="https://github.com/jameswlane/jest-express/commits?author=sheerun" title="Documentation">πŸ“–</a> <a href="https://github.com/jameswlane/jest-express/commits?author=sheerun" title="Tests">⚠️</a> <a href="#example-sheerun" title="Examples">πŸ’‘</a></td>
                    Severity: Info
                    Found in README.md by markdownlint

                    MD033 - Inline HTML

                    Tags: html

                    Aliases: no-inline-html

                    This rule is triggered whenever raw HTML is used in a markdown document:

                    Inline HTML header

                    To fix this, use 'pure' markdown instead of including raw HTML:

                    # Markdown header

                    Rationale: Raw HTML is allowed in markdown, but this rule is included for those who want their documents to only include "pure" markdown, or for those who are rendering markdown documents in something other than HTML.

                    Inline HTML
                    Open

                        <td align="center"><a href="https://github.com/G07cha"><img src="https://avatars3.githubusercontent.com/u/6943514?v=4" width="100px;" alt=""/><br /><sub><b>Konstantin Azizov</b></sub></a><br /><a href="https://github.com/jameswlane/jest-express/commits?author=G07cha" title="Documentation">πŸ“–</a></td>
                    Severity: Info
                    Found in README.md by markdownlint

                    MD033 - Inline HTML

                    Tags: html

                    Aliases: no-inline-html

                    This rule is triggered whenever raw HTML is used in a markdown document:

                    Inline HTML header

                    To fix this, use 'pure' markdown instead of including raw HTML:

                    # Markdown header

                    Rationale: Raw HTML is allowed in markdown, but this rule is included for those who want their documents to only include "pure" markdown, or for those who are rendering markdown documents in something other than HTML.

                    Inline HTML
                    Open

                        <td align="center"><a href="https://github.com/dozenne"><img src="https://avatars3.githubusercontent.com/u/1186932?v=4" width="100px;" alt=""/><br /><sub><b>dozenne</b></sub></a><br /><a href="https://github.com/jameswlane/jest-express/commits?author=dozenne" title="Code">πŸ’»</a> <a href="https://github.com/jameswlane/jest-express/commits?author=dozenne" title="Tests">⚠️</a></td>
                    Severity: Info
                    Found in README.md by markdownlint

                    MD033 - Inline HTML

                    Tags: html

                    Aliases: no-inline-html

                    This rule is triggered whenever raw HTML is used in a markdown document:

                    Inline HTML header

                    To fix this, use 'pure' markdown instead of including raw HTML:

                    # Markdown header

                    Rationale: Raw HTML is allowed in markdown, but this rule is included for those who want their documents to only include "pure" markdown, or for those who are rendering markdown documents in something other than HTML.

                    Severity
                    Category
                    Status
                    Source
                    Language