oplik0/cherrydoor

View on GitHub

Showing 650 of 650 total issues

Function generateCodeFrame has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
Open

function generateCodeFrame(source, start = 0, end = source.length) {
    const lines = source.split(/\r?\n/);
    let count = 0;
    const res = [];
    for (let i = 0; i < lines.length; i++) {
Severity: Minor
Found in cherrydoor/static/js/vue-dev.js - About 3 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 normalizeChildren has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
Open

function normalizeChildren(vnode, children) {
    let type = 0;
    const { shapeFlag } = vnode;
    if (children == null) {
            children = null;
Severity: Minor
Found in cherrydoor/static/js/vue-dev.js - About 3 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 get has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
Open

    get({ _: instance }, key) {
            const { ctx, setupState, data, props, accessCache, type, appContext } = instance;
            // let @vue/reactivity know it should never observe Vue public instances.
            if (key === "__v_skip" /* SKIP */) {
                    return true;
Severity: Minor
Found in cherrydoor/static/js/vue-dev.js - About 3 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 looseEqual has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
Open

function looseEqual(a, b) {
    if (a === b)
            return true;
    let aValidType = isDate(a);
    let bValidType = isDate(b);
Severity: Minor
Found in cherrydoor/static/js/vue-dev.js - About 3 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 processSlotOutlet has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
Open

function processSlotOutlet(node, context) {
    let slotName = `"default"`;
    let slotProps = undefined;
    const nonNameProps = [];
    for (let i = 0; i < node.props.length; i++) {
Severity: Minor
Found in cherrydoor/static/js/vue-dev.js - About 3 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 extract_uid has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
Open

    def extract_uid(self, block0: Union[str, bytearray]) -> str:
        """Extract UID from block 0.

        Works with all MiFare UID types :)

Severity: Minor
Found in cherrydoor/interface/serial.py - About 3 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

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    getActiveItemInSideColumn: function getActiveItemInSideColumn(currentColumn) {
      var toLeft = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
      var targetColumn = this.getSideColumnName(currentColumn, toLeft);

      if (!targetColumn) {
Severity: Major
Found in cherrydoor/static/components/VueTimepicker.js and 1 other location - About 3 hrs to fix
cherrydoor/static/components/VueTimepicker.js on lines 6850..6863

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 113.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    getFirstItemInSideColumn: function getFirstItemInSideColumn(currentColumn) {
      var toLeft = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
      var targetColumn = this.getSideColumnName(currentColumn, toLeft);

      if (!targetColumn) {
Severity: Major
Found in cherrydoor/static/components/VueTimepicker.js and 1 other location - About 3 hrs to fix
cherrydoor/static/components/VueTimepicker.js on lines 6864..6877

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 113.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Function tokensToParser has 95 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function tokensToParser(segments, extraOptions) {
    const options = assign({}, BASE_PATH_PARSER_OPTIONS, extraOptions);
    // the amount of scores is the same as the length of segments except for the root segment "/"
    let score = [];
    // the regexp as a string
Severity: Major
Found in cherrydoor/static/js/vue-router.js - About 3 hrs to fix

    Function tokenizePath has 94 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function tokenizePath(path) {
        if (!path) return [[]];
        if (path === "/") return [[ROOT_TOKEN]];
        if (!path.startsWith("/")) {
            throw new Error(
    Severity: Major
    Found in cherrydoor/static/js/vue-router.js - About 3 hrs to fix

      Function parseChildren has 94 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function parseChildren(context, mode, ancestors) {
          const parent = last(ancestors);
          const ns = parent ? parent.ns : 0 /* HTML */;
          const nodes = [];
          while (!isEnd(context, mode, ancestors)) {
      Severity: Major
      Found in cherrydoor/static/js/vue-dev.js - About 3 hrs to fix

        Function createTransformContext has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
        Open

        function createTransformContext(root, { filename = '', prefixIdentifiers = false, hoistStatic = false, cacheHandlers = false, nodeTransforms = [], directiveTransforms = {}, transformHoist = null, isBuiltInComponent = NOOP, isCustomElement = NOOP, expressionPlugins = [], scopeId = null, slotted = true, ssr = false, ssrCssVars = ``, bindingMetadata = EMPTY_OBJ, inline = false, isTS = false, onError = defaultOnError, onWarn = defaultOnWarn, compatConfig }) {
            const nameMatch = filename.replace(/\?.*$/, '').match(/([^/\\]+)\.\w+$/);
            const context = {
                    // options
                    selfName: nameMatch && capitalize(camelize(nameMatch[1])),
        Severity: Minor
        Found in cherrydoor/static/js/vue-dev.js - About 3 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 resolve has 93 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function resolve(rawLocation, currentLocation) {
                // const objectLocation = routerLocationAsObject(rawLocation)
                // we create a copy to modify it later
                currentLocation = assign({}, currentLocation || currentRoute.value);
                if (typeof rawLocation === "string") {
        Severity: Major
        Found in cherrydoor/static/js/vue-router.js - About 3 hrs to fix

          Function generate has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
          Open

          function generate(ast, options = {}) {
              const context = createCodegenContext(ast, options);
              if (options.onContextCreated)
                      options.onContextCreated(context);
              const { mode, push, prefixIdentifiers, indent, deindent, newline, scopeId, ssr } = context;
          Severity: Minor
          Found in cherrydoor/static/js/vue-dev.js - About 3 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 extractComponentsGuards has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
          Open

          function extractComponentsGuards(matched, guardType, to, from) {
              const guards = [];
              for (const record of matched) {
                  for (const name in record.components) {
                      let rawComponent = record.components[name];
          Severity: Minor
          Found in cherrydoor/static/js/vue-router.js - About 3 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

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

                if (this.inUse.minute && !this.isEmptyValue(this.minuteType, this.minute) && (!this.isValidValue(this.minuteType, this.minute) || this.isDisabled('minute', this.minute) || this.notInInterval('minute', this.minute))) {
                  result.push('minute');
                }
          Severity: Major
          Found in cherrydoor/static/components/VueTimepicker.js and 1 other location - About 3 hrs to fix
          cherrydoor/static/components/VueTimepicker.js on lines 5889..5891

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 106.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

                if (this.inUse.second && !this.isEmptyValue(this.secondType, this.second) && (!this.isValidValue(this.secondType, this.second) || this.isDisabled('second', this.second) || this.notInInterval('second', this.second))) {
                  result.push('second');
                }
          Severity: Major
          Found in cherrydoor/static/components/VueTimepicker.js and 1 other location - About 3 hrs to fix
          cherrydoor/static/components/VueTimepicker.js on lines 5885..5887

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 106.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          File cards_endpoint.py has 313 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import datetime as dt
          import json
          from typing import List
          
          from aiojobs.aiohttp import atomic
          Severity: Minor
          Found in cherrydoor/api/cards_endpoint.py - About 3 hrs to fix

            Function d784 has 87 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            /***/ (function(module, exports, __webpack_require__) {
            
            "use strict";
            
            // TODO: Remove from `core-js@4` since it's moved to entry points
            Severity: Major
            Found in cherrydoor/static/components/VueTimepicker.js - About 3 hrs to fix

              Function useHistoryStateNavigation has 86 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function useHistoryStateNavigation(base) {
                  const { history, location } = window;
                  // private variables
                  let currentLocation = {
                      value: createCurrentLocation(base, location),
              Severity: Major
              Found in cherrydoor/static/js/vue-router.js - About 3 hrs to fix
                Severity
                Category
                Status
                Source
                Language