apiaryio/fury-adapter-swagger

View on GitHub

Showing 64 of 64 total issues

Function oauthTransitions has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  oauthTransitions(element, oauth) {
    const { Transition } = this.minim.elements;

    if (oauth.authorizationUrl) {
      const transition = new Transition();
Severity: Minor
Found in src/parser.js - About 25 mins 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 baseLink has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export function baseLink(element, parser, relation, options = {}) {
  const { String: StringElement, Link } = parser.minim.elements;

  const opts = {
    path: options.path || [],
Severity: Minor
Found in src/link.js - About 25 mins 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 gatherResponseContentTypes has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  gatherResponseContentTypes(methodValue, examples) {
    let contentTypes = [];

    if (examples && Object.keys(examples).length > 0) {
      contentTypes = Object.keys(examples);
Severity: Minor
Found in src/parser.js - About 25 mins 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 createSourceMap has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  createSourceMap(element, path, produceLineColumnAttributes) {
    if (this.ast) {
      const NumberElement = this.minim.elements.Number;
      const SourceMap = this.minim.getElementClass('sourceMap');
      const position = this.ast.getPosition(path);
Severity: Minor
Found in src/parser.js - About 25 mins 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

Severity
Category
Status
Source
Language