Showing 126 of 199 total issues

File problem.py has 718 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import asyncio
import functools
import io
import os.path
import zipfile
Severity: Major
Found in vj4/handler/problem.py - About 1 day to fix

    Function default has 203 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export default function (env = {}) {
      function eslintLoader() {
        return {
          loader: 'eslint-loader',
          options: {
    Severity: Major
    Found in scripts/build/config/webpack.js - About 1 day to fix

      File builtin.py has 498 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import collections
      import datetime
      import functools
      import itertools
      
      
      Severity: Minor
      Found in vj4/model/builtin.py - About 7 hrs to fix

        File contest.py has 491 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import asyncio
        import collections
        import datetime
        import functools
        import itertools
        Severity: Minor
        Found in vj4/model/adaptor/contest.py - About 7 hrs to fix

          Function buildBodyData has 179 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            buildBodyData() {
              const now = moment();
              const days = [];
              {
                // back fill
          Severity: Major
          Found in vj4/ui/components/calendar/index.js - About 7 hrs to fix

            File base.py has 424 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import accept
            import asyncio
            import calendar
            import functools
            import hmac
            Severity: Minor
            Found in vj4/handler/base.py - About 6 hrs to fix

              File homework.py has 394 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import asyncio
              import collections
              import datetime
              import io
              import pytz
              Severity: Minor
              Found in vj4/handler/homework.py - About 5 hrs to fix

                Function page has 136 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                const page = new NamedPage('domain_manage_user', () => {
                  const addUserSelector = UserSelectAutoComplete.getOrConstruct($('.dialog__body--add-user [name="user"]'));
                  const addUserDialog = new ActionDialog({
                    $body: $('.dialog__body--add-user > div'),
                    onDispatch(action) {
                Severity: Major
                Found in vj4/ui/pages/domain_manage_user.page.js - About 5 hrs to fix

                  File document.py has 373 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import itertools
                  from bson import objectid
                  from pymongo import ReturnDocument
                  
                  from vj4 import db
                  Severity: Minor
                  Found in vj4/model/document.py - About 4 hrs to fix

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

                    const page = new NamedPage('domain_manage_user', () => {
                      const addUserSelector = UserSelectAutoComplete.getOrConstruct($('.dialog__body--add-user [name="user"]'));
                      const addUserDialog = new ActionDialog({
                        $body: $('.dialog__body--add-user > div'),
                        onDispatch(action) {
                    Severity: Minor
                    Found in vj4/ui/pages/domain_manage_user.page.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

                    File contest.py has 345 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    import asyncio
                    import calendar
                    import datetime
                    import io
                    import pytz
                    Severity: Minor
                    Found in vj4/handler/contest.py - About 4 hrs to fix

                      File index.js has 338 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      import _ from 'lodash';
                      import moment from 'moment';
                      import tpl from 'vj/utils/tpl';
                      
                      export default class Calendar {
                      Severity: Minor
                      Found in vj4/ui/components/calendar/index.js - About 4 hrs to fix

                        Function invoke_by_args has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                        Open

                        def invoke_by_args():
                          import argparse
                          import asyncio
                          import coloredlogs
                          import inspect
                        Severity: Minor
                        Found in vj4/util/argmethod.py - 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

                        File discussion.py has 328 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        import asyncio
                        import functools
                        from bson import objectid
                        
                        from vj4 import app
                        Severity: Minor
                        Found in vj4/handler/discussion.py - About 3 hrs to fix

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

                          def main():
                            if not options.syslog:
                              coloredlogs.install(level=logging.DEBUG if options.debug else logging.INFO,
                                                  fmt='[%(levelname).1s %(asctime)s %(module)s:%(lineno)d] %(message)s',
                                                  datefmt='%y%m%d %H:%M:%S')
                          Severity: Minor
                          Found in vj4/server.py - About 3 hrs to fix

                          Cognitive Complexity

                          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                          A method's cognitive complexity is based on a few simple rules:

                          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                          • Code is considered more complex for each "break in the linear flow of the code"
                          • Code is considered more complex when "flow breaking structures are nested"

                          Further reading

                          File domain.py has 318 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          import asyncio
                          import collections
                          import datetime
                          import functools
                          
                          
                          Severity: Minor
                          Found in vj4/handler/domain.py - About 3 hrs to fix

                            Function layout has 83 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                  .map(banners => {
                                    const dayBitmap = _
                                      .fill(new Array(7), 1)
                                      .map(() => []);
                                    banners.forEach(banner => {
                            Severity: Major
                            Found in vj4/ui/components/calendar/index.js - About 3 hrs to fix

                              Function reducer has 79 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              export default function reducer(state = {}, action) {
                                switch (action.type) {
                                case 'DIALOGUES_LOAD_DIALOGUES_FULFILLED': {
                                  const { messages, udict } = action.payload;
                                  return _.keyBy(
                              Severity: Major
                              Found in vj4/ui/components/messagepad/reducers/dialogues.js - About 3 hrs to fix

                                Function buildCategoryFilter has 77 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                function buildCategoryFilter() {
                                  const $container = $('[data-widget-cf-container]');
                                  if (!$container) {
                                    return;
                                  }
                                Severity: Major
                                Found in vj4/ui/pages/problem_main.page.js - About 3 hrs to fix

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

                                    constructor(options = {}) {
                                      super({
                                        autoDownloadFontAwesome: false,
                                        spellChecker: false,
                                        forceSync: true,
                                  Severity: Major
                                  Found in vj4/ui/components/cmeditor/vjcmeditor.js - About 2 hrs to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language