fga-eps-mds/2019.2-Vsign

View on GitHub

Showing 511 of 511 total issues

Cyclomatic complexity for gettext is too high. [7/6]
Open

  def gettext(document_photo)
    client = Aws::Rekognition::Client.new({
      region: Rails.application.credentials.dig(:aws, :region),
      credentials: Aws::Credentials.new(
        Rails.application.credentials.dig(:aws, :access_key_id),
Severity: Minor
Found in backend/app/jobs/id_check_job.rb by rubocop

This cop checks that the cyclomatic complexity of methods is not higher than the configured maximum. The cyclomatic complexity is the number of linearly independent paths through a method. The algorithm counts decision points and adds one.

An if statement (or unless or ?:) increases the complexity by one. An else branch does not, since it doesn't add a decision point. The && operator (or keyword and) can be converted to a nested if statement, and ||/or is shorthand for a sequence of ifs, so they also add one. Loops can be said to have an exit condition, so they add one.

Assignment Branch Condition size for execute is too high. [16.28/15]
Open

  def execute
    variables = ensure_hash(params[:variables])
    query = params[:query]
    operation_name = params[:operationName]
    context = {

This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

Assignment Branch Condition size for change is too high. [16/15]
Open

  def change
    create_table :active_storage_blobs do |t|
      t.string   :key,        null: false
      t.string   :filename,   null: false
      t.string   :content_type

This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

Function render has 44 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    render() {
        const { Line } = Progress;

        return (
            <Fragment>
Severity: Minor
Found in frontend/src/components/DocumentPage/index.js - About 1 hr to fix

    Assignment Branch Condition size for perform is too high. [15.52/15]
    Open

      def perform(contract_id)
        @client = Aws::Rekognition::Client.new({
        region: Rails.application.credentials.dig(:aws, :region),
        credentials: Aws::Credentials.new(
          Rails.application.credentials.dig(:aws, :access_key_id),
    Severity: Minor
    Found in backend/app/jobs/id_confirm_job.rb by rubocop

    This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

    Function renderActions has 41 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        renderActions() {
            if (this.state.successfullUploaded) {
                return (
                    <Button
                        style={{
    Severity: Minor
    Found in frontend/src/components/DocumentPage/index.js - About 1 hr to fix

      Function render has 37 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          render() {
              let { location } = this.props;
      
              let isModal = !!(
              location.state &&
      Severity: Minor
      Found in frontend/src/components/Script.js - About 1 hr to fix

        Function SigningSteps has 37 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function SigningSteps(history) {
            let url =  history.history.location.pathname;
            let current = 0;
            
            switch (url) {
        Severity: Minor
        Found in frontend/src/components/Shared/SigningSteps/index.js - About 1 hr to fix

          Function HowItWorks has 37 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export default function HowItWorks() {
              return (
                  <Section id="como-funciona">
                      <FlexboxGrid justify="space-around">
                          <FlexboxGrid.Item colspan={15}>
          Severity: Minor
          Found in frontend/src/components/LandingPage/HowItWorks.js - About 1 hr to fix

            Method gettext has 37 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def gettext(document_photo)
                client = Aws::Rekognition::Client.new({
                  region: Rails.application.credentials.dig(:aws, :region),
                  credentials: Aws::Credentials.new(
                    Rails.application.credentials.dig(:aws, :access_key_id),
            Severity: Minor
            Found in backend/app/jobs/id_check_job.rb - About 1 hr to fix

              Function LandingPage has 32 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const LandingPage = () => {
                  const [loginModal, setLoginModal] = useState(false);
                  const [email, setEmail] = useState('');
                  const [password, setPassword] = useState('');
                  return (
              Severity: Minor
              Found in frontend/src/components/LandingPage/LandingPage.js - About 1 hr to fix

                Function render has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    render() {
                        return (
                            <div>
                                <div className="show-fake-browser navbar-page">
                      <Container>
                Severity: Minor
                Found in frontend/src/components/ScriptPage/teste.js - About 1 hr to fix

                  Method gettext has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                    def gettext(document_photo)
                      client = Aws::Rekognition::Client.new({
                        region: Rails.application.credentials.dig(:aws, :region),
                        credentials: Aws::Credentials.new(
                          Rails.application.credentials.dig(:aws, :access_key_id),
                  Severity: Minor
                  Found in backend/app/jobs/id_check_job.rb - 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 sendRequest has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      sendRequest(file) {
                          return new Promise((resolve, reject) => {
                              const req = new XMLHttpRequest();
                  
                              req.upload.addEventListener("progress", event => {
                  Severity: Minor
                  Found in frontend/src/components/DocumentPage/index.js - About 1 hr to fix

                    Function registerValidSW has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function registerValidSW(swUrl, config) {
                      navigator.serviceWorker
                        .register(swUrl)
                        .then(registration => {
                          registration.onupdatefound = () => {
                    Severity: Minor
                    Found in frontend/src/serviceWorker.js - About 1 hr to fix

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

                          componentDidMount() {
                      
                              // instantiate Video.js
                              this.player = videojs(this.videoNode, videoJsOptions, () => {
                                  // print version information at startup
                      Severity: Minor
                      Found in frontend/src/components/RecordPage/Video.js - About 1 hr to fix

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

                        export default function Pricing() {
                            return (
                                <PricingSection id="precos">
                                    <FlexboxGrid justify="center">
                                        <FlexboxGrid.Item colspan={15}>
                        Severity: Minor
                        Found in frontend/src/components/LandingPage/Pricing.js - About 1 hr to fix

                          Function handleUploadImages has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function* handleUploadImages() {
                          
                              const { images } = yield select(state => state.record);
                              const selectedImages = shuffle(images).slice(0, 3);
                              
                          Severity: Minor
                          Found in frontend/src/sagas/upload.js - About 1 hr to fix

                            Function upload has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export default function upload(state = initial, action) {
                                switch (action.type) {
                                    case SET_VIDEO_UPLOAD_STATUS:
                                        return {
                                            ...state,
                            Severity: Minor
                            Found in frontend/src/reducers/upload.js - About 1 hr to fix

                              Function Navbar has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              export default function Navbar() {
                                  return (
                                      <header>
                                          <nav className="navbar navbar-expand-lg navbar-dark bg-info py-4">
                                              <div className="container">
                              Severity: Minor
                              Found in frontend/src/components/Shared/Navbar.js - About 1 hr to fix
                                Severity
                                Category
                                Status
                                Source
                                Language