oplik0/cherrydoor

View on GitHub
cherrydoor/static/js/vue-router.js

Summary

Maintainability
F
1 mo
Test Coverage

File vue-router.js has 2720 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
 * vue-router v4.0.8
 * (c) 2021 Eduardo San Martin Morote
 * @license MIT
 */
Severity: Major
Found in cherrydoor/static/js/vue-router.js - About 1 wk to fix

    Function createRouter has 540 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function createRouter(options) {
        const matcher = createRouterMatcher(options.routes, options);
        let parseQuery$1 = options.parseQuery || parseQuery;
        let stringifyQuery$1 = options.stringifyQuery || stringifyQuery;
        let routerHistory = options.history;
    Severity: Major
    Found in cherrydoor/static/js/vue-router.js - About 2 days to fix

      Function tokensToParser has a Cognitive Complexity of 132 (exceeds 5 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: Minor
      Found in cherrydoor/static/js/vue-router.js - About 2 days 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 createRouter has a Cognitive Complexity of 103 (exceeds 5 allowed). Consider refactoring.
      Open

      function createRouter(options) {
          const matcher = createRouterMatcher(options.routes, options);
          let parseQuery$1 = options.parseQuery || parseQuery;
          let stringifyQuery$1 = options.stringifyQuery || stringifyQuery;
          let routerHistory = options.history;
      Severity: Minor
      Found in cherrydoor/static/js/vue-router.js - About 2 days 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 createRouterMatcher has a Cognitive Complexity of 94 (exceeds 5 allowed). Consider refactoring.
      Open

      function createRouterMatcher(routes, globalOptions) {
          // normalized ordered array of matchers
          const matchers = [];
          const matcherMap = new Map();
          globalOptions = mergeOptions(
      Severity: Minor
      Found in cherrydoor/static/js/vue-router.js - About 1 day 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 tokenizePath has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
      Open

      function tokenizePath(path) {
          if (!path) return [[]];
          if (path === "/") return [[ROOT_TOKEN]];
          if (!path.startsWith("/")) {
              throw new Error(
      Severity: Minor
      Found in cherrydoor/static/js/vue-router.js - About 1 day 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 addDevtools has 179 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function addDevtools(app, router, matcher) {
          return;
          // Take over router.beforeEach and afterEach
          // make sure we are not registering the devtool twice
          if (router.__hasDevtools) return;
      Severity: Major
      Found in cherrydoor/static/js/vue-router.js - About 7 hrs to fix

        Function createRouterMatcher has 174 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function createRouterMatcher(routes, globalOptions) {
            // normalized ordered array of matchers
            const matchers = [];
            const matcherMap = new Map();
            globalOptions = mergeOptions(
        Severity: Major
        Found in cherrydoor/static/js/vue-router.js - About 6 hrs to fix

          Function scrollToPosition has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
          Open

          function scrollToPosition(position) {
              let scrollToOptions;
              if ("el" in position) {
                  let positionEl = position.el;
                  const isIdSelector =
          Severity: Minor
          Found in cherrydoor/static/js/vue-router.js - About 4 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 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 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 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

                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

                  Function navigate has 84 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      function navigate(to, from) {
                          let guards;
                          const [leavingRecords, updatingRecords, enteringRecords] =
                              extractChangingRecords(to, from);
                          // all components here have been resolved once because we are leaving
                  Severity: Major
                  Found in cherrydoor/static/js/vue-router.js - About 3 hrs to fix

                    Function extractComponentsGuards has 74 lines of code (exceeds 25 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: Major
                    Found in cherrydoor/static/js/vue-router.js - About 2 hrs to fix

                      Function pushWithRedirect has 72 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          function pushWithRedirect(to, redirectedFrom) {
                              const targetLocation = (pendingLocation = resolve(to));
                              const from = currentRoute.value;
                              const data = to.state;
                              const force = to.force;
                      Severity: Major
                      Found in cherrydoor/static/js/vue-router.js - About 2 hrs to fix

                        Function setup has 71 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            setup(props, { attrs, slots }) {
                                warnDeprecatedUsage();
                                const injectedRoute = inject(routerViewLocationKey);
                                const routeToDisplay = computed(() => props.route || injectedRoute.value);
                                const depth = inject(viewDepthKey, 0);
                        Severity: Major
                        Found in cherrydoor/static/js/vue-router.js - About 2 hrs to fix

                          Function addRoute has 71 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              function addRoute(record, parent, originalRecord) {
                                  // used later on to remove by name
                                  let isRootAdd = !originalRecord;
                                  let mainNormalizedRecord = normalizeRouteRecord(record);
                                  // we might be the child of an alias
                          Severity: Major
                          Found in cherrydoor/static/js/vue-router.js - About 2 hrs to fix

                            Function useHistoryListeners has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            function useHistoryListeners(base, historyState, currentLocation, replace) {
                                let listeners = [];
                                let teardowns = [];
                                // TODO: should it be a stack? a Dict. Check if the popstate listener
                                // can trigger twice
                            Severity: Major
                            Found in cherrydoor/static/js/vue-router.js - About 2 hrs to fix

                              Function createMemoryHistory has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              function createMemoryHistory(base = "") {
                                  let listeners = [];
                                  let queue = [START];
                                  let position = 0;
                                  function setLocation(location) {
                              Severity: Major
                              Found in cherrydoor/static/js/vue-router.js - About 2 hrs to fix

                                Function guardToPromiseFn has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                function guardToPromiseFn(guard, to, from, record, name) {
                                    // keep a reference to the enterCallbackArray to prevent pushing callbacks if a new navigation took place
                                    const enterCallbackArray =
                                        record &&
                                        // name is defined if record is because of the function overload
                                Severity: Major
                                Found in cherrydoor/static/js/vue-router.js - About 2 hrs to fix

                                  Function formatRouteRecordForInspector has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  function formatRouteRecordForInspector(route) {
                                      const tags = [];
                                      const { record } = route;
                                      if (record.name != null) {
                                          tags.push({
                                  Severity: Major
                                  Found in cherrydoor/static/js/vue-router.js - About 2 hrs to fix

                                    Function resolve has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        function resolve(location, currentLocation) {
                                            let matcher;
                                            let params = {};
                                            let path;
                                            let name;
                                    Severity: Major
                                    Found in cherrydoor/static/js/vue-router.js - About 2 hrs to fix

                                      Function formatRouteRecordMatcherForStateInspector has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      function formatRouteRecordMatcherForStateInspector(route) {
                                          const { record } = route;
                                          const fields = [{ editable: false, key: "path", value: record.path }];
                                          if (record.name != null) {
                                              fields.push({
                                      Severity: Major
                                      Found in cherrydoor/static/js/vue-router.js - About 2 hrs to fix

                                        Function useHistoryListeners has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                                        Open

                                        function useHistoryListeners(base, historyState, currentLocation, replace) {
                                            let listeners = [];
                                            let teardowns = [];
                                            // TODO: should it be a stack? a Dict. Check if the popstate listener
                                            // can trigger twice
                                        Severity: Minor
                                        Found in cherrydoor/static/js/vue-router.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 parseQuery has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                                        Open

                                        function parseQuery(search) {
                                            const query = {};
                                            // avoid creating an object with an empty key and empty value
                                            // because of split('&')
                                            if (search === "" || search === "?") return query;
                                        Severity: Minor
                                        Found in cherrydoor/static/js/vue-router.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 setup has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            setup(props, { slots }) {
                                                const link = reactive(useLink(props));
                                                const { options } = inject(routerKey);
                                                const elClass = computed(() => ({
                                                    [getLinkClass(
                                        Severity: Minor
                                        Found in cherrydoor/static/js/vue-router.js - About 1 hr to fix

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

                                              function setupListeners() {
                                                  removeHistoryListener = routerHistory.listen((to, _from, info) => {
                                                      // cannot be a redirect route because it was in history
                                                      let toLocation = resolve(to);
                                                      // due to dynamic routing, and to hash history with manual navigation
                                          Severity: Minor
                                          Found in cherrydoor/static/js/vue-router.js - About 1 hr to fix

                                            Function useHistoryStateNavigation has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                                            Open

                                            function useHistoryStateNavigation(base) {
                                                const { history, location } = window;
                                                // private variables
                                                let currentLocation = {
                                                    value: createCurrentLocation(base, location),
                                            Severity: Minor
                                            Found in cherrydoor/static/js/vue-router.js - 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 normalizeQuery has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                                            Open

                                            function normalizeQuery(query) {
                                                const normalizedQuery = {};
                                                for (let key in query) {
                                                    let value = query[key];
                                                    if (value !== undefined) {
                                            Severity: Minor
                                            Found in cherrydoor/static/js/vue-router.js - 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 useLink has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                                            Open

                                            function useLink(props) {
                                                const router = inject(routerKey);
                                                const currentRoute = inject(routeLocationKey);
                                                const route = computed(() => router.resolve(unref(props.to)));
                                                const activeRecordIndex = computed(() => {
                                            Severity: Minor
                                            Found in cherrydoor/static/js/vue-router.js - About 1 hr to fix

                                              Function scrollToPosition has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                                              Open

                                              function scrollToPosition(position) {
                                                  let scrollToOptions;
                                                  if ("el" in position) {
                                                      let positionEl = position.el;
                                                      const isIdSelector =
                                              Severity: Minor
                                              Found in cherrydoor/static/js/vue-router.js - About 1 hr to fix

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

                                                        install(app) {
                                                            const router = this;
                                                            app.component("RouterLink", RouterLink);
                                                            app.component("RouterView", RouterView);
                                                            app.config.globalProperties.$router = router;
                                                Severity: Minor
                                                Found in cherrydoor/static/js/vue-router.js - About 1 hr to fix

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

                                                  function stringifyQuery(query) {
                                                      let search = "";
                                                      for (let key in query) {
                                                          const value = query[key];
                                                          key = encodeQueryKey(key);
                                                  Severity: Minor
                                                  Found in cherrydoor/static/js/vue-router.js - 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 useLink has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                                                  Open

                                                  function useLink(props) {
                                                      const router = inject(routerKey);
                                                      const currentRoute = inject(routeLocationKey);
                                                      const route = computed(() => router.resolve(unref(props.to)));
                                                      const activeRecordIndex = computed(() => {
                                                  Severity: Minor
                                                  Found in cherrydoor/static/js/vue-router.js - 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 handleRedirectRecord has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                                  Open

                                                      function handleRedirectRecord(to) {
                                                          const lastMatched = to.matched[to.matched.length - 1];
                                                          if (lastMatched && lastMatched.redirect) {
                                                              const { redirect } = lastMatched;
                                                              let newTargetLocation =
                                                  Severity: Minor
                                                  Found in cherrydoor/static/js/vue-router.js - About 1 hr to fix

                                                    Function includesParams has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                                                    Open

                                                    function includesParams(outer, inner) {
                                                        for (let key in inner) {
                                                            let innerValue = inner[key];
                                                            let outerValue = outer[key];
                                                            if (typeof innerValue === "string") {
                                                    Severity: Minor
                                                    Found in cherrydoor/static/js/vue-router.js - 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 isRouteMatching has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                                                    Open

                                                    function isRouteMatching(route, filter) {
                                                        const found = String(route.re).match(EXTRACT_REGEXP_RE);
                                                        route.__vd_match = false;
                                                        if (!found || found.length < 3) {
                                                            return false;
                                                    Severity: Minor
                                                    Found in cherrydoor/static/js/vue-router.js - 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 extractChangingRecords has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                                                    Open

                                                    function extractChangingRecords(to, from) {
                                                        const leavingRecords = [];
                                                        const updatingRecords = [];
                                                        const enteringRecords = [];
                                                        const len = Math.max(from.matched.length, to.matched.length);
                                                    Severity: Minor
                                                    Found in cherrydoor/static/js/vue-router.js - 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 createWebHistory has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                                    Open

                                                    function createWebHistory(base) {
                                                        base = normalizeBase(base);
                                                        const historyNavigation = useHistoryStateNavigation(base);
                                                        const historyListeners = useHistoryListeners(
                                                            base,
                                                    Severity: Minor
                                                    Found in cherrydoor/static/js/vue-router.js - About 1 hr to fix

                                                      Function resolveRelativePath has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                                      Open

                                                      function resolveRelativePath(to, from) {
                                                          if (to.startsWith("/")) return to;
                                                          if (!from.startsWith("/")) {
                                                              warn(
                                                                  `Cannot resolve a relative location without an absolute path. Trying to resolve "${to}" from "${from}". It should look like "/${from}".`
                                                      Severity: Minor
                                                      Found in cherrydoor/static/js/vue-router.js - 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 stringify has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                                      Open

                                                          function stringify(params) {
                                                              let path = "";
                                                              // for optional parameters to allow to be empty
                                                              let avoidDuplicatedSlash = false;
                                                              for (const segment of segments) {
                                                      Severity: Minor
                                                      Found in cherrydoor/static/js/vue-router.js - About 1 hr to fix

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

                                                        function resolveRelativePath(to, from) {
                                                            if (to.startsWith("/")) return to;
                                                            if (!from.startsWith("/")) {
                                                                warn(
                                                                    `Cannot resolve a relative location without an absolute path. Trying to resolve "${to}" from "${from}". It should look like "/${from}".`
                                                        Severity: Minor
                                                        Found in cherrydoor/static/js/vue-router.js - About 1 hr to fix

                                                          Function guardEvent has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                                          Open

                                                          function guardEvent(e) {
                                                              // don't redirect with control keys
                                                              if (e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) return;
                                                              // don't redirect when preventDefault called
                                                              if (e.defaultPrevented) return;
                                                          Severity: Minor
                                                          Found in cherrydoor/static/js/vue-router.js - About 55 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 compareScoreArray has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                                          Open

                                                          function compareScoreArray(a, b) {
                                                              let i = 0;
                                                              while (i < a.length && i < b.length) {
                                                                  const diff = b[i] - a[i];
                                                                  // only keep going if diff === 0
                                                          Severity: Minor
                                                          Found in cherrydoor/static/js/vue-router.js - About 55 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 formatRouteRecordForInspector has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                                          Open

                                                          function formatRouteRecordForInspector(route) {
                                                              const tags = [];
                                                              const { record } = route;
                                                              if (record.name != null) {
                                                                  tags.push({
                                                          Severity: Minor
                                                          Found in cherrydoor/static/js/vue-router.js - About 55 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 createMemoryHistory has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                                          Open

                                                          function createMemoryHistory(base = "") {
                                                              let listeners = [];
                                                              let queue = [START];
                                                              let position = 0;
                                                              function setLocation(location) {
                                                          Severity: Minor
                                                          Found in cherrydoor/static/js/vue-router.js - About 55 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

                                                          Avoid deeply nested control flow statements.
                                                          Open

                                                                          if (re !== BASE_PARAM_PATTERN) {
                                                                              subSegmentScore += 10 /* BonusCustomRegExp */;
                                                                              // make sure the regexp is valid before using it
                                                                              try {
                                                                                  new RegExp(`(${re})`);
                                                          Severity: Major
                                                          Found in cherrydoor/static/js/vue-router.js - About 45 mins to fix

                                                            Avoid deeply nested control flow statements.
                                                            Open

                                                                            if (optional) subSegmentScore += -8 /* BonusOptional */;
                                                            Severity: Major
                                                            Found in cherrydoor/static/js/vue-router.js - About 45 mins to fix

                                                              Avoid deeply nested control flow statements.
                                                              Open

                                                                                      if (optional) {
                                                                                          // if we have more than one optional param like /:a?-static we
                                                                                          // don't need to care about the optional param
                                                                                          if (segment.length < 2) {
                                                                                              // remove the last slash as we could be at the end
                                                              Severity: Major
                                                              Found in cherrydoor/static/js/vue-router.js - About 45 mins to fix

                                                                Function parseURL has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                                                Open

                                                                function parseURL(parseQuery, location, currentLocation = "/") {
                                                                    let path,
                                                                        query = {},
                                                                        searchString = "",
                                                                        hash = "";
                                                                Severity: Minor
                                                                Found in cherrydoor/static/js/vue-router.js - About 45 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

                                                                Avoid deeply nested control flow statements.
                                                                Open

                                                                                if (optional) subPattern += "?";
                                                                Severity: Major
                                                                Found in cherrydoor/static/js/vue-router.js - About 45 mins to fix

                                                                  Avoid deeply nested control flow statements.
                                                                  Open

                                                                                  if (!tokenIndex)
                                                                                      subPattern =
                                                                                          // avoid an optional / if there are more segments e.g. /:p?-static
                                                                                          // or /:p?-:p2
                                                                                          optional && segment.length < 2
                                                                  Severity: Major
                                                                  Found in cherrydoor/static/js/vue-router.js - About 45 mins to fix

                                                                    Function normalizeBase has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                                                    Open

                                                                    function normalizeBase(base) {
                                                                        if (!base) {
                                                                            if (isBrowser) {
                                                                                // respect <base> tag
                                                                                const baseEl = document.querySelector("base");
                                                                    Severity: Minor
                                                                    Found in cherrydoor/static/js/vue-router.js - About 45 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

                                                                    Avoid deeply nested control flow statements.
                                                                    Open

                                                                                    if (re === ".*") subSegmentScore += -50 /* BonusWildcard */;
                                                                    Severity: Major
                                                                    Found in cherrydoor/static/js/vue-router.js - About 45 mins to fix

                                                                      Avoid deeply nested control flow statements.
                                                                      Open

                                                                                      if (repeatable) subSegmentScore += -20 /* BonusRepeatable */;
                                                                      Severity: Major
                                                                      Found in cherrydoor/static/js/vue-router.js - About 45 mins to fix

                                                                        Consider simplifying this complex logical expression.
                                                                        Open

                                                                                        if (
                                                                                            instance &&
                                                                                            to &&
                                                                                            // if there is no instance but to and from are the same this might be
                                                                                            // the first visit
                                                                        Severity: Major
                                                                        Found in cherrydoor/static/js/vue-router.js - About 40 mins to fix

                                                                          Function buildState has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                          Open

                                                                              back,
                                                                              current,
                                                                              forward,
                                                                              replaced = false,
                                                                              computeScroll = false
                                                                          Severity: Minor
                                                                          Found in cherrydoor/static/js/vue-router.js - About 35 mins to fix

                                                                            Function finalizeNavigation has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                            Open

                                                                                function finalizeNavigation(toLocation, from, isPush, replace, data) {
                                                                            Severity: Minor
                                                                            Found in cherrydoor/static/js/vue-router.js - About 35 mins to fix

                                                                              Function guardToPromiseFn has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                              Open

                                                                              function guardToPromiseFn(guard, to, from, record, name) {
                                                                              Severity: Minor
                                                                              Found in cherrydoor/static/js/vue-router.js - About 35 mins to fix

                                                                                Function normalizeRecordProps has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                                                Open

                                                                                function normalizeRecordProps(record) {
                                                                                    const propsObject = {};
                                                                                    // props does not exist on redirect records but we can set false directly
                                                                                    const props = record.props || false;
                                                                                    if ("component" in record) {
                                                                                Severity: Minor
                                                                                Found in cherrydoor/static/js/vue-router.js - About 35 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

                                                                                Avoid too many return statements within this function.
                                                                                Open

                                                                                        return true;
                                                                                Severity: Major
                                                                                Found in cherrydoor/static/js/vue-router.js - About 30 mins to fix

                                                                                  Avoid too many return statements within this function.
                                                                                  Open

                                                                                      return route.children.some((child) => isRouteMatching(child, filter));
                                                                                  Severity: Major
                                                                                  Found in cherrydoor/static/js/vue-router.js - About 30 mins to fix

                                                                                    Avoid too many return statements within this function.
                                                                                    Open

                                                                                        if (decodedPath.startsWith(filter) || path.startsWith(filter)) return true;
                                                                                    Severity: Major
                                                                                    Found in cherrydoor/static/js/vue-router.js - About 30 mins to fix

                                                                                      Avoid too many return statements within this function.
                                                                                      Open

                                                                                          return true;
                                                                                      Severity: Major
                                                                                      Found in cherrydoor/static/js/vue-router.js - About 30 mins to fix

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

                                                                                        function createRouteRecordMatcher(record, parent, options) {
                                                                                            const parser = tokensToParser(tokenizePath(record.path), options);
                                                                                            // warn against params with the same name
                                                                                            {
                                                                                                const existingKeys = new Set();
                                                                                        Severity: Minor
                                                                                        Found in cherrydoor/static/js/vue-router.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 checkSameParams has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                        Open

                                                                                        function checkSameParams(a, b) {
                                                                                            for (let key of a.keys) {
                                                                                                if (!key.optional && !b.keys.find(isSameParam.bind(null, key)))
                                                                                                    return warn(
                                                                                                        `Alias "${b.record.path}" and the original record: "${a.record.path}" should have the exact same param named "${key.name}"`
                                                                                        Severity: Minor
                                                                                        Found in cherrydoor/static/js/vue-router.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 modifierForKey has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                        Open

                                                                                        function modifierForKey(key) {
                                                                                            if (key.optional) {
                                                                                                return key.repeatable ? "*" : "?";
                                                                                            } else {
                                                                                                return key.repeatable ? "+" : "";
                                                                                        Severity: Minor
                                                                                        Found in cherrydoor/static/js/vue-router.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

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

                                                                                            for (let key of b.keys) {
                                                                                                if (!key.optional && !a.keys.find(isSameParam.bind(null, key)))
                                                                                                    return warn(
                                                                                                        `Alias "${b.record.path}" and the original record: "${a.record.path}" should have the exact same param named "${key.name}"`
                                                                                                    );
                                                                                        Severity: Major
                                                                                        Found in cherrydoor/static/js/vue-router.js and 1 other location - About 3 hrs to fix
                                                                                        cherrydoor/static/js/vue-router.js on lines 1623..1628

                                                                                        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 98.

                                                                                        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

                                                                                            for (let key of a.keys) {
                                                                                                if (!key.optional && !b.keys.find(isSameParam.bind(null, key)))
                                                                                                    return warn(
                                                                                                        `Alias "${b.record.path}" and the original record: "${a.record.path}" should have the exact same param named "${key.name}"`
                                                                                                    );
                                                                                        Severity: Major
                                                                                        Found in cherrydoor/static/js/vue-router.js and 1 other location - About 3 hrs to fix
                                                                                        cherrydoor/static/js/vue-router.js on lines 1629..1634

                                                                                        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 98.

                                                                                        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

                                                                                                    runGuardQueue(guards)
                                                                                                        .then(() => {
                                                                                                            // check global guards beforeEach
                                                                                                            guards = [];
                                                                                                            for (const guard of beforeGuards.list()) {
                                                                                        Severity: Major
                                                                                        Found in cherrydoor/static/js/vue-router.js and 1 other location - About 1 hr to fix
                                                                                        cherrydoor/static/js/vue-router.js on lines 3259..3327

                                                                                        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 72.

                                                                                        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

                                                                                        function onBeforeRouteLeave(leaveGuard) {
                                                                                            if (!getCurrentInstance()) {
                                                                                                warn(
                                                                                                    "getCurrentInstance() returned null. onBeforeRouteLeave() must be called at the top of a setup function"
                                                                                                );
                                                                                        Severity: Major
                                                                                        Found in cherrydoor/static/js/vue-router.js and 1 other location - About 1 hr to fix
                                                                                        cherrydoor/static/js/vue-router.js on lines 1944..1959

                                                                                        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 67.

                                                                                        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

                                                                                        function onBeforeRouteUpdate(updateGuard) {
                                                                                            if (!getCurrentInstance()) {
                                                                                                warn(
                                                                                                    "getCurrentInstance() returned null. onBeforeRouteUpdate() must be called at the top of a setup function"
                                                                                                );
                                                                                        Severity: Major
                                                                                        Found in cherrydoor/static/js/vue-router.js and 1 other location - About 1 hr to fix
                                                                                        cherrydoor/static/js/vue-router.js on lines 1921..1936

                                                                                        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 67.

                                                                                        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

                                                                                            function add(handler) {
                                                                                                handlers.push(handler);
                                                                                                return () => {
                                                                                                    const i = handlers.indexOf(handler);
                                                                                                    if (i > -1) handlers.splice(i, 1);
                                                                                        Severity: Major
                                                                                        Found in cherrydoor/static/js/vue-router.js and 1 other location - About 1 hr to fix
                                                                                        cherrydoor/static/js/vue-router.js on lines 732..738

                                                                                        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 60.

                                                                                        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

                                                                                                listen(callback) {
                                                                                                    listeners.push(callback);
                                                                                                    return () => {
                                                                                                        const index = listeners.indexOf(callback);
                                                                                                        if (index > -1) listeners.splice(index, 1);
                                                                                        Severity: Major
                                                                                        Found in cherrydoor/static/js/vue-router.js and 1 other location - About 1 hr to fix
                                                                                        cherrydoor/static/js/vue-router.js on lines 1886..1892

                                                                                        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 60.

                                                                                        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

                                                                                            [4 /* NAVIGATION_ABORTED */]({ from, to }) {
                                                                                                return `Navigation aborted from "${from.fullPath}" to "${to.fullPath}" via a navigation guard.`;
                                                                                            },
                                                                                        Severity: Minor
                                                                                        Found in cherrydoor/static/js/vue-router.js and 1 other location - About 40 mins to fix
                                                                                        cherrydoor/static/js/vue-router.js on lines 886..888

                                                                                        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 48.

                                                                                        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

                                                                                            [8 /* NAVIGATION_CANCELLED */]({ from, to }) {
                                                                                                return `Navigation cancelled from "${from.fullPath}" to "${to.fullPath}" with a new navigation.`;
                                                                                            },
                                                                                        Severity: Minor
                                                                                        Found in cherrydoor/static/js/vue-router.js and 1 other location - About 40 mins to fix
                                                                                        cherrydoor/static/js/vue-router.js on lines 883..885

                                                                                        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 48.

                                                                                        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 (record.redirect != null) {
                                                                                                fields.push({
                                                                                                    editable: false,
                                                                                                    key: "redirect",
                                                                                                    value: record.redirect,
                                                                                        Severity: Minor
                                                                                        Found in cherrydoor/static/js/vue-router.js and 1 other location - About 35 mins to fix
                                                                                        cherrydoor/static/js/vue-router.js on lines 2720..2726

                                                                                        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 46.

                                                                                        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 (record.name != null) {
                                                                                                fields.push({
                                                                                                    editable: false,
                                                                                                    key: "name",
                                                                                                    value: record.name,
                                                                                        Severity: Minor
                                                                                        Found in cherrydoor/static/js/vue-router.js and 1 other location - About 35 mins to fix
                                                                                        cherrydoor/static/js/vue-router.js on lines 2745..2751

                                                                                        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 46.

                                                                                        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

                                                                                                                `Component "${name}" in record with path "${record.path}" is a ` +
                                                                                                                    `Promise instead of a function that returns a Promise. Did you ` +
                                                                                                                    `write "import('./MyPage.vue')" instead of ` +
                                                                                                                    `"() => import('./MyPage.vue')" ? This will break in ` +
                                                                                        Severity: Minor
                                                                                        Found in cherrydoor/static/js/vue-router.js and 1 other location - About 30 mins to fix
                                                                                        cherrydoor/static/js/vue-router.js on lines 2080..2083

                                                                                        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 45.

                                                                                        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

                                                                                                                `Component "${name}" in record with path "${record.path}" is defined ` +
                                                                                                                    `using "defineAsyncComponent()". ` +
                                                                                                                    `Write "() => import('./MyPage.vue')" instead of ` +
                                                                                                                    `"defineAsyncComponent(() => import('./MyPage.vue'))".`
                                                                                        Severity: Minor
                                                                                        Found in cherrydoor/static/js/vue-router.js and 1 other location - About 30 mins to fix
                                                                                        cherrydoor/static/js/vue-router.js on lines 2065..2068

                                                                                        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 45.

                                                                                        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

                                                                                        There are no issues that match your filters.

                                                                                        Category
                                                                                        Status